Skip to content

Commit feed9cf

Browse files
jotapegJuan Pablo González
authored andcommitted
Fix StackOverflowException when instantiating JSONObject on Android (#938)
(cherry picked from commit c0f92a2)
1 parent 7dbbfe8 commit feed9cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

common/src/main/java/com/genexus/json/JSONTokenerWrapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.genexus.json;
22

3+
import org.json.JSONObject;
34
import org.json.JSONTokener;
45
import org.json.JSONException;
56

@@ -14,7 +15,7 @@ public Object nextValue() throws JSONException {
1415
this.back();
1516
if (c == '{') {
1617
try {
17-
return new JSONObjectWrapper(this);
18+
return new JSONObjectWrapper((JSONObject) super.nextValue());
1819
} catch (StackOverflowError e) {
1920
throw new JSONException("JSON Array or Object depth too large to process.", e);
2021
}

0 commit comments

Comments
 (0)