1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 16:00:51 -07:00

change length comparison to isEmpty method

This commit is contained in:
Andrei_Paikin 2018-05-21 16:58:13 +03:00
parent a490ebdb78
commit 05074386d3
5 changed files with 25 additions and 25 deletions

View file

@ -224,7 +224,7 @@ public class CDL {
*/
public static JSONArray toJSONArray(JSONArray names, JSONTokener x)
throws JSONException {
if (names == null || names.length() == 0) {
if (names == null || names.isEmpty()) {
return null;
}
JSONArray ja = new JSONArray();
@ -235,7 +235,7 @@ public class CDL {
}
ja.put(jo);
}
if (ja.length() == 0) {
if (ja.isEmpty()) {
return null;
}
return ja;
@ -272,7 +272,7 @@ public class CDL {
*/
public static String toString(JSONArray names, JSONArray ja)
throws JSONException {
if (names == null || names.length() == 0) {
if (names == null || names.isEmpty()) {
return null;
}
StringBuffer sb = new StringBuffer();