Skip to content

Commit e1703f7

Browse files
authored
Migrate to non-deprecated methods (getNewJsonObject() -> getJsonObject()) (#222)
1 parent 6246da2 commit e1703f7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,23 +1952,23 @@ public enum TYPE
19521952

19531953
public String getJobName()
19541954
{
1955-
return getNewJsonObject().optString("jobName");
1955+
return getJsonObject().optString("jobName");
19561956
}
19571957

19581958
public String getDescription()
19591959
{
1960-
return getNewJsonObject().optString("description");
1960+
return getJsonObject().optString("description");
19611961
}
19621962

19631963
public TYPE getType()
19641964
{
1965-
return !getNewJsonObject().has("type") ? null : TYPE.valueOf(getNewJsonObject().getString("type"));
1965+
return !getJsonObject().has("type") ? null : TYPE.valueOf(getJsonObject().getString("type"));
19661966
}
19671967

19681968
public JSONObject getJobParameters()
19691969
{
1970-
// Return clone so we dont mutate it:
1971-
return new JSONObject(getNewJsonObject().optJSONObject("jobParameters").toMap());
1970+
// Return clone so we don't mutate it:
1971+
return new JSONObject(getJsonObject().optJSONObject("jobParameters").toMap());
19721972
}
19731973

19741974
public JSONArray getReadsetIds()

jbrowse/src/org/labkey/jbrowse/JBrowseController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,14 +414,14 @@ public static class ModifyAttributesAction extends MutatingApiAction<SimpleApiJs
414414
@Override
415415
public ApiResponse execute(SimpleApiJsonForm form, BindException errors)
416416
{
417-
JSONArray jsonFiles = form.getNewJsonObject().getJSONArray("jsonFiles");
417+
JSONArray jsonFiles = form.getJsonObject().getJSONArray("jsonFiles");
418418
Set<String> objectIds = new HashSet<>();
419419
for (Object o : jsonFiles.toList())
420420
{
421421
objectIds.add(o.toString());
422422
}
423423

424-
JSONObject attributes = form.getNewJsonObject().getJSONObject("attributes");
424+
JSONObject attributes = form.getJsonObject().getJSONObject("attributes");
425425

426426
final Map<Container, List<Map<String, Object>>> rows = new HashMap<>();
427427
TableSelector ts = new TableSelector(JBrowseSchema.getInstance().getTable(JBrowseSchema.TABLE_JSONFILES), PageFlowUtil.set("objectid", "container", "trackJson"), new SimpleFilter(FieldKey.fromString("objectid"), objectIds, CompareType.IN), null);

singlecell/src/org/labkey/singlecell/SingleCellController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,12 @@ private static void validateBarcodes(List<Map<String, Object>> readsetRows, Cont
346346

347347
private static List<Map<String, Object>> parseRows(SimpleApiJsonForm form, String propName, Container container) throws ApiUsageException
348348
{
349-
if (!form.getNewJsonObject().has(propName))
349+
if (!form.getJsonObject().has(propName))
350350
{
351351
throw new ApiUsageException("Missing property: " + propName);
352352
}
353353

354-
JSONArray arr = form.getNewJsonObject().getJSONArray(propName);
354+
JSONArray arr = form.getJsonObject().getJSONArray(propName);
355355

356356
List<Map<String, Object>> ret = new ArrayList<>();
357357
JsonUtil.toJSONObjectList(arr).forEach(m -> {

0 commit comments

Comments
 (0)