commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1671624 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java
Date Mon, 06 Apr 2015 18:06:41 GMT
Author: britter
Date: Mon Apr  6 18:06:41 2015
New Revision: 1671624

URL: http://svn.apache.org/r1671624
Log:
Simplify isNotEmpty by reusing isEmpty

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=1671624&r1=1671623&r2=1671624&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 Mon Apr
 6 18:06:41 2015
@@ -3554,7 +3554,7 @@ public class ArrayUtils {
      * @since 2.5
      */
      public static <T> boolean isNotEmpty(final T[] array) {
-         return (array != null && array.length != 0);
+         return !isEmpty(array);
      }
 
     /**
@@ -3565,7 +3565,7 @@ public class ArrayUtils {
      * @since 2.5
      */
     public static boolean isNotEmpty(final long[] array) {
-        return (array != null && array.length != 0);
+        return !isEmpty(array);
     }
 
     /**
@@ -3576,7 +3576,7 @@ public class ArrayUtils {
      * @since 2.5
      */
     public static boolean isNotEmpty(final int[] array) {
-        return (array != null && array.length != 0);
+        return !isEmpty(array);
     }
 
     /**
@@ -3587,7 +3587,7 @@ public class ArrayUtils {
      * @since 2.5
      */
     public static boolean isNotEmpty(final short[] array) {
-        return (array != null && array.length != 0);
+        return !isEmpty(array);
     }
 
     /**
@@ -3598,7 +3598,7 @@ public class ArrayUtils {
      * @since 2.5
      */
     public static boolean isNotEmpty(final char[] array) {
-        return (array != null && array.length != 0);
+        return !isEmpty(array);
     }
 
     /**
@@ -3609,7 +3609,7 @@ public class ArrayUtils {
      * @since 2.5
      */
     public static boolean isNotEmpty(final byte[] array) {
-        return (array != null && array.length != 0);
+        return !isEmpty(array);
     }
 
     /**
@@ -3620,7 +3620,7 @@ public class ArrayUtils {
      * @since 2.5
      */
     public static boolean isNotEmpty(final double[] array) {
-        return (array != null && array.length != 0);
+        return !isEmpty(array);
     }
 
     /**
@@ -3631,7 +3631,7 @@ public class ArrayUtils {
      * @since 2.5
      */
     public static boolean isNotEmpty(final float[] array) {
-        return (array != null && array.length != 0);
+        return !isEmpty(array);
     }
 
     /**
@@ -3642,7 +3642,7 @@ public class ArrayUtils {
      * @since 2.5
      */
     public static boolean isNotEmpty(final boolean[] array) {
-        return (array != null && array.length != 0);
+        return !isEmpty(array);
     }
 
     /**



Mime
View raw message