File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
sources/net.sf.j2s.java.core/src/swingjs/json Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,10 @@ public static Object parse(String json) {
103103 }
104104
105105 public static Object parse (Reader br ) {
106- return ((JSONReader ) br ).data ;
106+ if (br instanceof JSONReader )
107+ return ((JSONReader ) br ).data ;
108+ InputStream is = /** @j2sNative br.$in || */ null ;
109+ return parse (is );
107110 }
108111
109112 /**
@@ -164,11 +167,14 @@ public static class JSONReader extends BufferedReader {
164167 Object data ;
165168
166169 public JSONReader (InputStream in ) {
167- super ((Reader ) (Object ) in );
170+ super ((Reader ) (Object ) "" );
168171 // could be buffered
169172 data = toObject (/** @j2sNative $in._ajaxData || $in.$in && $in.$in._ajaxData || */
170173 null );
171-
174+ if (data == null ) {
175+ String json = (/** @j2sNative $in.str || $in.$in && $in.$in.str || */ null );
176+ data = toObject (JSUtil .parseJSONRaw (json ));
177+ }
172178 }
173179
174180 public JSONReader (Reader in ) {
You can’t perform that action at this time.
0 commit comments