commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r980201 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java
Date Wed, 28 Jul 2010 20:40:17 GMT
Author: mbenson
Date: Wed Jul 28 20:40:16 2010
New Revision: 980201

URL: http://svn.apache.org/viewvc?rev=980201&view=rev
Log:
s/if (foo) { return true; } return false;/return foo;/g

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java?rev=980201&r1=980200&r2=980201&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java Wed Jul
28 20:40:16 2010
@@ -3219,11 +3219,8 @@ public class ArrayUtils {
      * @return <code>true</code> if the array is empty or <code>null</code>
      * @since 2.1
      */
-    public static <T> 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;
     }
 
     // ----------------------------------------------------------------------



Mime
View raw message