diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java index 1faa21e5f40..1288394db5c 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java @@ -5276,7 +5276,7 @@ public static T[] remove(final T[] array, final int index) { * array is always the same as that of the input array. *

*

- * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. + * If the input array is {@code null}, {@code null} will be returned. *

* *
@@ -5286,8 +5286,8 @@ public static  T[] remove(final T[] array, final int index) {
      *
      * @param array   the array to remove the element from, may not be {@code null}.
      * @param indices the positions of the elements to be removed.
-     * @return A new array containing the existing elements except those at the specified positions.
-     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}.
+     * @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
+     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length).
      * @since 3.0.1
      */
     public static boolean[] removeAll(final boolean[] array, final int... indices) {
@@ -5301,7 +5301,7 @@ public static boolean[] removeAll(final boolean[] array, final int... indices) {
      * array is always the same as that of the input array.
      * 

*

- * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. + * If the input array is {@code null}, {@code null} will be returned. *

* *
@@ -5315,8 +5315,8 @@ public static boolean[] removeAll(final boolean[] array, final int... indices) {
      *
      * @param array   the array to remove the element from, may not be {@code null}.
      * @param indices the positions of the elements to be removed.
-     * @return A new array containing the existing elements except those at the specified positions.
-     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}.
+     * @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
+     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length).
      * @since 3.0.1
      */
     public static byte[] removeAll(final byte[] array, final int... indices) {
@@ -5330,7 +5330,7 @@ public static byte[] removeAll(final byte[] array, final int... indices) {
      * array is always the same as that of the input array.
      * 

*

- * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. + * If the input array is {@code null}, {@code null} will be returned. *

* *
@@ -5344,8 +5344,8 @@ public static byte[] removeAll(final byte[] array, final int... indices) {
      *
      * @param array   the array to remove the element from, may not be {@code null}.
      * @param indices the positions of the elements to be removed.
-     * @return A new array containing the existing elements except those at the specified positions.
-     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}.
+     * @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
+     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length).
      * @since 3.0.1
      */
     public static char[] removeAll(final char[] array, final int... indices) {
@@ -5359,7 +5359,7 @@ public static char[] removeAll(final char[] array, final int... indices) {
      * array is always the same as that of the input array.
      * 

*

- * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. + * If the input array is {@code null}, {@code null} will be returned. *

* *
@@ -5373,8 +5373,8 @@ public static char[] removeAll(final char[] array, final int... indices) {
      *
      * @param array   the array to remove the element from, may not be {@code null}.
      * @param indices the positions of the elements to be removed.
-     * @return A new array containing the existing elements except those at the specified positions.
-     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}.
+     * @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
+     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length).
      * @since 3.0.1
      */
     public static double[] removeAll(final double[] array, final int... indices) {
@@ -5388,7 +5388,7 @@ public static double[] removeAll(final double[] array, final int... indices) {
      * array is always the same as that of the input array.
      * 

*

- * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. + * If the input array is {@code null}, {@code null} will be returned. *

* *
@@ -5402,8 +5402,8 @@ public static double[] removeAll(final double[] array, final int... indices) {
      *
      * @param array   the array to remove the element from, may not be {@code null}.
      * @param indices the positions of the elements to be removed.
-     * @return A new array containing the existing elements except those at the specified positions.
-     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}.
+     * @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
+     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length).
      * @since 3.0.1
      */
     public static float[] removeAll(final float[] array, final int... indices) {
@@ -5417,7 +5417,7 @@ public static float[] removeAll(final float[] array, final int... indices) {
      * array is always the same as that of the input array.
      * 

*

- * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. + * If the input array is {@code null}, {@code null} will be returned. *

* *
@@ -5431,8 +5431,8 @@ public static float[] removeAll(final float[] array, final int... indices) {
      *
      * @param array   the array to remove the element from, may not be {@code null}.
      * @param indices the positions of the elements to be removed.
-     * @return A new array containing the existing elements except those at the specified positions.
-     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}.
+     * @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
+     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length).
      * @since 3.0.1
      */
     public static int[] removeAll(final int[] array, final int... indices) {
@@ -5446,7 +5446,7 @@ public static int[] removeAll(final int[] array, final int... indices) {
      * array is always the same as that of the input array.
      * 

*

- * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. + * If the input array is {@code null}, {@code null} will be returned. *

* *
@@ -5460,8 +5460,8 @@ public static int[] removeAll(final int[] array, final int... indices) {
      *
      * @param array   the array to remove the element from, may not be {@code null}.
      * @param indices the positions of the elements to be removed.
-     * @return A new array containing the existing elements except those at the specified positions.
-     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}.
+     * @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
+     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length).
      * @since 3.0.1
      */
     public static long[] removeAll(final long[] array, final int... indices) {
@@ -5528,7 +5528,7 @@ static Object removeAll(final Object array, final int... indices) {
      * array is always the same as that of the input array.
      * 

*

- * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. + * If the input array is {@code null}, {@code null} will be returned. *

* *
@@ -5542,8 +5542,8 @@ static Object removeAll(final Object array, final int... indices) {
      *
      * @param array   the array to remove the element from, may not be {@code null}.
      * @param indices the positions of the elements to be removed.
-     * @return A new array containing the existing elements except those at the specified positions.
-     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}.
+     * @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
+     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length).
      * @since 3.0.1
      */
     public static short[] removeAll(final short[] array, final int... indices) {
@@ -5557,7 +5557,7 @@ public static short[] removeAll(final short[] array, final int... indices) {
      * array is always the same as that of the input array.
      * 

*

- * If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified. + * If the input array is {@code null}, {@code null} will be returned. *

* *
@@ -5568,8 +5568,8 @@ public static short[] removeAll(final short[] array, final int... indices) {
      * @param      the component type of the array.
      * @param array   the array to remove the element from, may not be {@code null}.
      * @param indices the positions of the elements to be removed.
-     * @return A new array containing the existing elements except those at the specified positions.
-     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length), or if the array is {@code null}.
+     * @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
+     * @throws IndexOutOfBoundsException if any index is out of range (index < 0 || index >= array.length).
      * @since 3.0.1
      */
     @SuppressWarnings("unchecked") // removeAll() always creates an array of the same type as its input