1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
Description: JSONObject was wrongly invoked
It was called with a wrong package name, "simple" being forgotten.
Moreover it is called on an AlignmentPojo object, I added the getAppSettings
method in the call to get a HashMap<String, Object>.
Author: Pierre Gruet <pgt@debian.org>
Forwarded: jalview-dev@jalview.org
Last-Update: 2020-11-15
--- a/src/jalview/io/JSONFile.java
+++ b/src/jalview/io/JSONFile.java
@@ -219,7 +219,7 @@
}
}
- jsonOutput = JSONUtils.stringify(jsonAlignmentPojo);
+ jsonOutput = JSONUtils.stringify(new org.json.simple.JSONObject(jsonAlignmentPojo.getAppSettings()));
return jsonOutput.replaceAll("xstart", "xStart").replaceAll("xend",
"xEnd");
} catch (Exception e)
--- a/src/jalview/util/JSONUtils.java
+++ b/src/jalview/util/JSONUtils.java
@@ -85,9 +85,9 @@
return Platform.parseJSON(json);
}
- public static String stringify(Object obj)
+ public static String stringify(org.json.simple.JSONObject obj)
{
- return new org.json.JSONObject(obj).toString();
+ return obj.toString();
}
}
|