Skip to content

Commit 5407423

Browse files
committed
stleary#863 replace usage of back() method in JSONObject parsing
1 parent 63625b3 commit 5407423

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/json/JSONObject.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ public JSONObject(JSONTokener x) throws JSONException {
214214
if (x.nextClean() != '{') {
215215
throw x.syntaxError("A JSONObject text must begin with '{'");
216216
}
217+
c = x.nextClean();
217218
for (;;) {
218-
c = x.nextClean();
219219
switch (c) {
220220
case 0:
221221
throw x.syntaxError("A JSONObject text must end with '}'");
@@ -252,13 +252,13 @@ public JSONObject(JSONTokener x) throws JSONException {
252252
switch (x.nextClean()) {
253253
case ';':
254254
case ',':
255-
if (x.nextClean() == '}') {
255+
c = x.nextClean();
256+
if (c == '}') {
256257
return;
257258
}
258259
if (x.end()) {
259260
throw x.syntaxError("A JSONObject text must end with '}'");
260261
}
261-
x.back();
262262
break;
263263
case '}':
264264
return;

0 commit comments

Comments
 (0)