mirror of
https://github.com/stleary/JSON-java.git
synced 2026-03-20 00:00:50 -04:00
Remove unnecessary conditions
This commit is contained in:
@@ -391,7 +391,7 @@ public class XML {
|
|||||||
context.append(tagName, JSONObject.NULL);
|
context.append(tagName, JSONObject.NULL);
|
||||||
} else if (jsonObject.length() > 0) {
|
} else if (jsonObject.length() > 0) {
|
||||||
context.append(tagName, jsonObject);
|
context.append(tagName, jsonObject);
|
||||||
} 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
|
} else if(context.isEmpty()) { //avoids resetting the array in case of an empty tag in the middle or end
|
||||||
context.put(tagName, new JSONArray());
|
context.put(tagName, new JSONArray());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -452,7 +452,7 @@ public class XML {
|
|||||||
// Force the value to be an array
|
// Force the value to be an array
|
||||||
if (jsonObject.length() == 0) {
|
if (jsonObject.length() == 0) {
|
||||||
//avoids resetting the array in case of an empty element in the middle or end
|
//avoids resetting the array in case of an empty element in the middle or end
|
||||||
if(context.length()==0 && context.opt(tagName) == null || !(context.get(tagName) instanceof JSONArray)) {
|
if(context.isEmpty()) {
|
||||||
context.put(tagName, new JSONArray());
|
context.put(tagName, new JSONArray());
|
||||||
}
|
}
|
||||||
} else if (jsonObject.length() == 1
|
} else if (jsonObject.length() == 1
|
||||||
|
|||||||
Reference in New Issue
Block a user