File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ public class JSONML {
1717 /**
1818 * Constructs a new JSONML object.
1919 */
20- public JSONML () {
20+ private JSONML () {
2121 }
2222
23+
2324 /**
2425 * Parse XML values and store them in a JSONArray.
2526 * @param x The XMLTokener containing the source string.
@@ -239,9 +240,21 @@ private static Object parse(
239240 }
240241 } else {
241242 if (ja != null ) {
242- ja .put (token instanceof String
243- ? (config .isKeepStrings () ? XML .unescape ((String )token ) : XML .stringToValue ((String )token ))
244- : token );
243+ Object value ;
244+
245+ if (token instanceof String ) {
246+ String strToken = (String ) token ;
247+ if (config .isKeepStrings ()) {
248+ value = XML .unescape (strToken );
249+ } else {
250+ value = XML .stringToValue (strToken );
251+ }
252+ } else {
253+ value = token ;
254+ }
255+
256+ ja .put (value );
257+
245258 }
246259 }
247260 }
You can’t perform that action at this time.
0 commit comments