Skip to content

Commit 80b2672

Browse files
Sean LearySean Leary
authored andcommitted
restore-jsonparserconfiguration: clean up some whitespace
1 parent 1f308db commit 80b2672

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/main/java/org/json/JSONArray.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,24 @@ public JSONArray(JSONTokener x, JSONParserConfiguration jsonParserConfiguration)
115115
this.myArrayList.add(x.nextValue());
116116
}
117117
switch (x.nextClean()) {
118-
case 0:
118+
case 0:
119+
// array is unclosed. No ']' found, instead EOF
120+
throw x.syntaxError("Expected a ',' or ']'");
121+
case ',':
122+
nextChar = x.nextClean();
123+
if (nextChar == 0) {
119124
// array is unclosed. No ']' found, instead EOF
120125
throw x.syntaxError("Expected a ',' or ']'");
121-
case ',':
122-
nextChar = x.nextClean();
123-
if (nextChar == 0) {
124-
// array is unclosed. No ']' found, instead EOF
125-
throw x.syntaxError("Expected a ',' or ']'");
126-
}
127-
if (nextChar == ']') {
128-
return;
129-
}
130-
x.back();
131-
break;
132-
case ']':
126+
}
127+
if (nextChar == ']') {
133128
return;
134-
default:
135-
throw x.syntaxError("Expected a ',' or ']'");
129+
}
130+
x.back();
131+
break;
132+
case ']':
133+
return;
134+
default:
135+
throw x.syntaxError("Expected a ',' or ']'");
136136
}
137137
}
138138
}

0 commit comments

Comments
 (0)