File: using_right_json_simple_package.patch

package info (click to toggle)
jalview 2.11.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 445,392 kB
  • sloc: java: 365,549; xml: 2,989; sh: 1,511; perl: 336; lisp: 139; python: 116; makefile: 81; haskell: 60
file content (33 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download | duplicates (3)
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();
   }
 
 }