From 4a26a86d0c0d9a72a0505ceedc7f1e39b984c302 Mon Sep 17 00:00:00 2001 From: Benedikt Ritter Date: Fri, 19 Aug 2016 09:49:51 +0200 Subject: [PATCH] LANG-1259: JavaDoc for ArrayUtils.isNotEmpty() is slightly misleading. Thanks to Dominik Stadler. --- src/changes/changes.xml | 1 + .../org/apache/commons/lang3/ArrayUtils.java | 36 +++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index dcb488581..c89b9fcca 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -46,6 +46,7 @@ The type attribute can be add,update,fix,remove. + JavaDoc for ArrayUtils.isNotEmpty() is slightly misleading Add APIs StringUtils.wrapIfMissing(String, char|String) TypeUtils.isAssignable throws NullPointerException when fromType has type variables and toType generic superclass specifies type variable StringUtils#normalizeSpace does not trim the string anymore diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java index 4df429045..1d33fcf13 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java @@ -4894,11 +4894,11 @@ public static boolean isEmpty(final boolean[] array) { // ---------------------------------------------------------------------- /** - *

Checks if an array of Objects is not empty or not {@code null}. + *

Checks if an array of Objects is not empty and not {@code null}. * * @param the component type of the array * @param array the array to test - * @return {@code true} if the array is not empty or not {@code null} + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final T[] array) { @@ -4906,10 +4906,10 @@ public static boolean isNotEmpty(final T[] array) { } /** - *

Checks if an array of primitive longs is not empty or not {@code null}. + *

Checks if an array of primitive longs is not empty and not {@code null}. * * @param array the array to test - * @return {@code true} if the array is not empty or not {@code null} + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final long[] array) { @@ -4917,10 +4917,10 @@ public static boolean isNotEmpty(final long[] array) { } /** - *

Checks if an array of primitive ints is not empty or not {@code null}. + *

Checks if an array of primitive ints is not empty and not {@code null}. * * @param array the array to test - * @return {@code true} if the array is not empty or not {@code null} + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final int[] array) { @@ -4928,10 +4928,10 @@ public static boolean isNotEmpty(final int[] array) { } /** - *

Checks if an array of primitive shorts is not empty or not {@code null}. + *

Checks if an array of primitive shorts is not empty and not {@code null}. * * @param array the array to test - * @return {@code true} if the array is not empty or not {@code null} + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final short[] array) { @@ -4939,10 +4939,10 @@ public static boolean isNotEmpty(final short[] array) { } /** - *

Checks if an array of primitive chars is not empty or not {@code null}. + *

Checks if an array of primitive chars is not empty and not {@code null}. * * @param array the array to test - * @return {@code true} if the array is not empty or not {@code null} + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final char[] array) { @@ -4950,10 +4950,10 @@ public static boolean isNotEmpty(final char[] array) { } /** - *

Checks if an array of primitive bytes is not empty or not {@code null}. + *

Checks if an array of primitive bytes is not empty and not {@code null}. * * @param array the array to test - * @return {@code true} if the array is not empty or not {@code null} + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final byte[] array) { @@ -4961,10 +4961,10 @@ public static boolean isNotEmpty(final byte[] array) { } /** - *

Checks if an array of primitive doubles is not empty or not {@code null}. + *

Checks if an array of primitive doubles is not empty and not {@code null}. * * @param array the array to test - * @return {@code true} if the array is not empty or not {@code null} + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final double[] array) { @@ -4972,10 +4972,10 @@ public static boolean isNotEmpty(final double[] array) { } /** - *

Checks if an array of primitive floats is not empty or not {@code null}. + *

Checks if an array of primitive floats is not empty and not {@code null}. * * @param array the array to test - * @return {@code true} if the array is not empty or not {@code null} + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final float[] array) { @@ -4983,10 +4983,10 @@ public static boolean isNotEmpty(final float[] array) { } /** - *

Checks if an array of primitive booleans is not empty or not {@code null}. + *

Checks if an array of primitive booleans is not empty and not {@code null}. * * @param array the array to test - * @return {@code true} if the array is not empty or not {@code null} + * @return {@code true} if the array is not empty and not {@code null} * @since 2.5 */ public static boolean isNotEmpty(final boolean[] array) {