Skip to content

Commit 38c3a0b

Browse files
committed
more sonarcube issues
1 parent ebd9a17 commit 38c3a0b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@ public JSONObject(JSONTokener x) throws JSONException {
200200
*/
201201
public JSONObject(JSONTokener x, JSONParserConfiguration jsonParserConfiguration) throws JSONException {
202202
this();
203-
char c;
204-
String key;
205-
Object obj;
206-
207203
boolean isInitial = x.getPrevious() == 0;
208204

209205
if (x.nextClean() != '{') {
@@ -227,8 +223,8 @@ public JSONObject(JSONTokener x, JSONParserConfiguration jsonParserConfiguration
227223
private boolean parseJSONObject(JSONTokener jsonTokener, JSONParserConfiguration jsonParserConfiguration, boolean isInitial) {
228224
Object obj;
229225
String key;
230-
char c;
231-
c = jsonTokener.nextClean();
226+
boolean doneParsing = false;
227+
char c = jsonTokener.nextClean();
232228

233229
switch (c) {
234230
case 0:
@@ -268,10 +264,10 @@ private boolean parseJSONObject(JSONTokener jsonTokener, JSONParserConfiguration
268264

269265
// Pairs are separated by ','.
270266
if (parseEndOfKeyValuePair(jsonTokener, jsonParserConfiguration, isInitial)) {
271-
return true;
267+
doneParsing = true;
272268
}
273-
// Not finished parsing
274-
return false;
269+
270+
return doneParsing;
275271
}
276272

277273
/**

0 commit comments

Comments
 (0)