Skip to content

Commit

Permalink
Fixed U.isEmpty for primitive type arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Nov 21, 2015
1 parent 5f5682b commit b1aacd0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion rapidoid-u/src/main/java/org/rapidoid/u/U.java
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,24 @@ public static boolean isEmpty(Object value) {
return true;
} else if (value instanceof String) {
return isEmpty((String) value);
} else if (value instanceof byte[]) {
return ((byte[]) value).length == 0;
} else if (value instanceof short[]) {
return ((short[]) value).length == 0;
} else if (value instanceof int[]) {
return ((int[]) value).length == 0;
} else if (value instanceof long[]) {
return ((long[]) value).length == 0;
} else if (value instanceof float[]) {
return ((float[]) value).length == 0;
} else if (value instanceof double[]) {
return ((double[]) value).length == 0;
} else if (value instanceof boolean[]) {
return ((boolean[]) value).length == 0;
} else if (value instanceof char[]) {
return ((char[]) value).length == 0;
} else if (value instanceof Object[]) {
return isEmpty((Object[]) value);
return ((Object[]) value).length == 0;
} else if (value instanceof Collection<?>) {
return isEmpty((Collection<?>) value);
} else if (value instanceof Map<?, ?>) {
Expand Down

0 comments on commit b1aacd0

Please sign in to comment.