From 5bfa8550e8b69a0dfcf0be91955438c4ac7d613c Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Wed, 28 Jul 2010 20:40:16 +0000 Subject: [PATCH] s/if (foo) { return true; } return false;/return foo;/g git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@980201 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/lang3/ArrayUtils.java | 47 ++++--------------- 1 file changed, 10 insertions(+), 37 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java index bf1318d39..94eb14d5a 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java @@ -3219,11 +3219,8 @@ public class ArrayUtils { * @return true if the array is empty or null * @since 2.1 */ - public static boolean isEmpty(T[] array) { - if (array == null || array.length == 0) { - return true; - } - return false; + public static boolean isEmpty(Object[] array) { + return array == null || array.length == 0; } /** @@ -3234,10 +3231,7 @@ public class ArrayUtils { * @since 2.1 */ public static boolean isEmpty(long[] array) { - if (array == null || array.length == 0) { - return true; - } - return false; + return array == null || array.length == 0; } /** @@ -3248,10 +3242,7 @@ public class ArrayUtils { * @since 2.1 */ public static boolean isEmpty(int[] array) { - if (array == null || array.length == 0) { - return true; - } - return false; + return array == null || array.length == 0; } /** @@ -3262,10 +3253,7 @@ public class ArrayUtils { * @since 2.1 */ public static boolean isEmpty(short[] array) { - if (array == null || array.length == 0) { - return true; - } - return false; + return array == null || array.length == 0; } /** @@ -3276,10 +3264,7 @@ public class ArrayUtils { * @since 2.1 */ public static boolean isEmpty(char[] array) { - if (array == null || array.length == 0) { - return true; - } - return false; + return array == null || array.length == 0; } /** @@ -3290,10 +3275,7 @@ public class ArrayUtils { * @since 2.1 */ public static boolean isEmpty(byte[] array) { - if (array == null || array.length == 0) { - return true; - } - return false; + return array == null || array.length == 0; } /** @@ -3304,10 +3286,7 @@ public class ArrayUtils { * @since 2.1 */ public static boolean isEmpty(double[] array) { - if (array == null || array.length == 0) { - return true; - } - return false; + return array == null || array.length == 0; } /** @@ -3318,10 +3297,7 @@ public class ArrayUtils { * @since 2.1 */ public static boolean isEmpty(float[] array) { - if (array == null || array.length == 0) { - return true; - } - return false; + return array == null || array.length == 0; } /** @@ -3332,10 +3308,7 @@ public class ArrayUtils { * @since 2.1 */ public static boolean isEmpty(boolean[] array) { - if (array == null || array.length == 0) { - return true; - } - return false; + return array == null || array.length == 0; } // ----------------------------------------------------------------------