Skip to content

Commit

Permalink
stleary#863 replace usage of back() method in JSONObject parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Simulant87 committed Mar 5, 2024
1 parent 63625b3 commit 5407423
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/json/JSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ public JSONObject(JSONTokener x) throws JSONException {
if (x.nextClean() != '{') {
throw x.syntaxError("A JSONObject text must begin with '{'");
}
c = x.nextClean();
for (;;) {
c = x.nextClean();
switch (c) {
case 0:
throw x.syntaxError("A JSONObject text must end with '}'");
Expand Down Expand Up @@ -252,13 +252,13 @@ public JSONObject(JSONTokener x) throws JSONException {
switch (x.nextClean()) {
case ';':
case ',':
if (x.nextClean() == '}') {
c = x.nextClean();
if (c == '}') {
return;
}
if (x.end()) {
throw x.syntaxError("A JSONObject text must end with '}'");
}
x.back();
break;
case '}':
return;
Expand Down

0 comments on commit 5407423

Please sign in to comment.