Skip to content

Commit 7a8da88

Browse files
Remove unnecessary conditions
1 parent 995fb84 commit 7a8da88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/json/XML.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ private static boolean parse(XMLTokener x, JSONObject context, String name, XMLP
391391
context.append(tagName, JSONObject.NULL);
392392
} else if (jsonObject.length() > 0) {
393393
context.append(tagName, jsonObject);
394-
} else if(context.isEmpty() && (context.opt(tagName) == null || !(context.get(tagName) instanceof JSONArray))) { //avoids resetting the array in case of an empty tag in the middle or end
394+
} else if(context.isEmpty()) { //avoids resetting the array in case of an empty tag in the middle or end
395395
context.put(tagName, new JSONArray());
396396
}
397397
} else {
@@ -452,7 +452,7 @@ private static boolean parse(XMLTokener x, JSONObject context, String name, XMLP
452452
// Force the value to be an array
453453
if (jsonObject.length() == 0) {
454454
//avoids resetting the array in case of an empty element in the middle or end
455-
if(context.length()==0 && context.opt(tagName) == null || !(context.get(tagName) instanceof JSONArray)) {
455+
if(context.isEmpty()) {
456456
context.put(tagName, new JSONArray());
457457
}
458458
} else if (jsonObject.length() == 1

0 commit comments

Comments
 (0)