Skip to content

Commit c28cc55

Browse files
LANG-1819: Fix ArrayUtils.removeAll() Javadoc for null array input (#1614)
* updated the javadoc for Arrayutils.removeAll to match the implementation which returns null in case of null input * fixed the grammar * fixed the grammar
1 parent 7f07c82 commit c28cc55

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

src/main/java/org/apache/commons/lang3/ArrayUtils.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5276,7 +5276,7 @@ public static <T> T[] remove(final T[] array, final int index) {
52765276
* array is always the same as that of the input array.
52775277
* </p>
52785278
* <p>
5279-
* If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.
5279+
* If the input array is {@code null}, {@code null} will be returned.
52805280
* </p>
52815281
*
52825282
* <pre>
@@ -5286,8 +5286,8 @@ public static <T> T[] remove(final T[] array, final int index) {
52865286
*
52875287
* @param array the array to remove the element from, may not be {@code null}.
52885288
* @param indices the positions of the elements to be removed.
5289-
* @return A new array containing the existing elements except those at the specified positions.
5290-
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length), or if the array is {@code null}.
5289+
* @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
5290+
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length).
52915291
* @since 3.0.1
52925292
*/
52935293
public static boolean[] removeAll(final boolean[] array, final int... indices) {
@@ -5301,7 +5301,7 @@ public static boolean[] removeAll(final boolean[] array, final int... indices) {
53015301
* array is always the same as that of the input array.
53025302
* </p>
53035303
* <p>
5304-
* If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.
5304+
* If the input array is {@code null}, {@code null} will be returned.
53055305
* </p>
53065306
*
53075307
* <pre>
@@ -5315,8 +5315,8 @@ public static boolean[] removeAll(final boolean[] array, final int... indices) {
53155315
*
53165316
* @param array the array to remove the element from, may not be {@code null}.
53175317
* @param indices the positions of the elements to be removed.
5318-
* @return A new array containing the existing elements except those at the specified positions.
5319-
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length), or if the array is {@code null}.
5318+
* @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
5319+
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length).
53205320
* @since 3.0.1
53215321
*/
53225322
public static byte[] removeAll(final byte[] array, final int... indices) {
@@ -5330,7 +5330,7 @@ public static byte[] removeAll(final byte[] array, final int... indices) {
53305330
* array is always the same as that of the input array.
53315331
* </p>
53325332
* <p>
5333-
* If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.
5333+
* If the input array is {@code null}, {@code null} will be returned.
53345334
* </p>
53355335
*
53365336
* <pre>
@@ -5344,8 +5344,8 @@ public static byte[] removeAll(final byte[] array, final int... indices) {
53445344
*
53455345
* @param array the array to remove the element from, may not be {@code null}.
53465346
* @param indices the positions of the elements to be removed.
5347-
* @return A new array containing the existing elements except those at the specified positions.
5348-
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length), or if the array is {@code null}.
5347+
* @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
5348+
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length).
53495349
* @since 3.0.1
53505350
*/
53515351
public static char[] removeAll(final char[] array, final int... indices) {
@@ -5359,7 +5359,7 @@ public static char[] removeAll(final char[] array, final int... indices) {
53595359
* array is always the same as that of the input array.
53605360
* </p>
53615361
* <p>
5362-
* If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.
5362+
* If the input array is {@code null}, {@code null} will be returned.
53635363
* </p>
53645364
*
53655365
* <pre>
@@ -5373,8 +5373,8 @@ public static char[] removeAll(final char[] array, final int... indices) {
53735373
*
53745374
* @param array the array to remove the element from, may not be {@code null}.
53755375
* @param indices the positions of the elements to be removed.
5376-
* @return A new array containing the existing elements except those at the specified positions.
5377-
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length), or if the array is {@code null}.
5376+
* @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
5377+
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length).
53785378
* @since 3.0.1
53795379
*/
53805380
public static double[] removeAll(final double[] array, final int... indices) {
@@ -5388,7 +5388,7 @@ public static double[] removeAll(final double[] array, final int... indices) {
53885388
* array is always the same as that of the input array.
53895389
* </p>
53905390
* <p>
5391-
* If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.
5391+
* If the input array is {@code null}, {@code null} will be returned.
53925392
* </p>
53935393
*
53945394
* <pre>
@@ -5402,8 +5402,8 @@ public static double[] removeAll(final double[] array, final int... indices) {
54025402
*
54035403
* @param array the array to remove the element from, may not be {@code null}.
54045404
* @param indices the positions of the elements to be removed.
5405-
* @return A new array containing the existing elements except those at the specified positions.
5406-
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length), or if the array is {@code null}.
5405+
* @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
5406+
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length).
54075407
* @since 3.0.1
54085408
*/
54095409
public static float[] removeAll(final float[] array, final int... indices) {
@@ -5417,7 +5417,7 @@ public static float[] removeAll(final float[] array, final int... indices) {
54175417
* array is always the same as that of the input array.
54185418
* </p>
54195419
* <p>
5420-
* If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.
5420+
* If the input array is {@code null}, {@code null} will be returned.
54215421
* </p>
54225422
*
54235423
* <pre>
@@ -5431,8 +5431,8 @@ public static float[] removeAll(final float[] array, final int... indices) {
54315431
*
54325432
* @param array the array to remove the element from, may not be {@code null}.
54335433
* @param indices the positions of the elements to be removed.
5434-
* @return A new array containing the existing elements except those at the specified positions.
5435-
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length), or if the array is {@code null}.
5434+
* @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
5435+
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length).
54365436
* @since 3.0.1
54375437
*/
54385438
public static int[] removeAll(final int[] array, final int... indices) {
@@ -5446,7 +5446,7 @@ public static int[] removeAll(final int[] array, final int... indices) {
54465446
* array is always the same as that of the input array.
54475447
* </p>
54485448
* <p>
5449-
* If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.
5449+
* If the input array is {@code null}, {@code null} will be returned.
54505450
* </p>
54515451
*
54525452
* <pre>
@@ -5460,8 +5460,8 @@ public static int[] removeAll(final int[] array, final int... indices) {
54605460
*
54615461
* @param array the array to remove the element from, may not be {@code null}.
54625462
* @param indices the positions of the elements to be removed.
5463-
* @return A new array containing the existing elements except those at the specified positions.
5464-
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length), or if the array is {@code null}.
5463+
* @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
5464+
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length).
54655465
* @since 3.0.1
54665466
*/
54675467
public static long[] removeAll(final long[] array, final int... indices) {
@@ -5528,7 +5528,7 @@ static Object removeAll(final Object array, final int... indices) {
55285528
* array is always the same as that of the input array.
55295529
* </p>
55305530
* <p>
5531-
* If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.
5531+
* If the input array is {@code null}, {@code null} will be returned.
55325532
* </p>
55335533
*
55345534
* <pre>
@@ -5542,8 +5542,8 @@ static Object removeAll(final Object array, final int... indices) {
55425542
*
55435543
* @param array the array to remove the element from, may not be {@code null}.
55445544
* @param indices the positions of the elements to be removed.
5545-
* @return A new array containing the existing elements except those at the specified positions.
5546-
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length), or if the array is {@code null}.
5545+
* @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
5546+
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length).
55475547
* @since 3.0.1
55485548
*/
55495549
public static short[] removeAll(final short[] array, final int... indices) {
@@ -5557,7 +5557,7 @@ public static short[] removeAll(final short[] array, final int... indices) {
55575557
* array is always the same as that of the input array.
55585558
* </p>
55595559
* <p>
5560-
* If the input array is {@code null}, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.
5560+
* If the input array is {@code null}, {@code null} will be returned.
55615561
* </p>
55625562
*
55635563
* <pre>
@@ -5568,8 +5568,8 @@ public static short[] removeAll(final short[] array, final int... indices) {
55685568
* @param <T> the component type of the array.
55695569
* @param array the array to remove the element from, may not be {@code null}.
55705570
* @param indices the positions of the elements to be removed.
5571-
* @return A new array containing the existing elements except those at the specified positions.
5572-
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length), or if the array is {@code null}.
5571+
* @return A new array containing the existing elements except those at the specified positions or {@code null} if the input array is {@code null}.
5572+
* @throws IndexOutOfBoundsException if any index is out of range (index &lt; 0 || index &gt;= array.length).
55735573
* @since 3.0.1
55745574
*/
55755575
@SuppressWarnings("unchecked") // removeAll() always creates an array of the same type as its input

0 commit comments

Comments
 (0)