@@ -2435,7 +2435,7 @@ public static int indexOf(final byte[] array, final byte valueToFind) {
24352435 * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input.
24362436 */
24372437 public static int indexOf (final byte [] array , final byte valueToFind , final int startIndex ) {
2438- if (array == null ) {
2438+ if (isEmpty ( array ) ) {
24392439 return INDEX_NOT_FOUND ;
24402440 }
24412441 for (int i = max0 (startIndex ); i < array .length ; i ++) {
@@ -2477,7 +2477,7 @@ public static int indexOf(final char[] array, final char valueToFind) {
24772477 * @since 2.1
24782478 */
24792479 public static int indexOf (final char [] array , final char valueToFind , final int startIndex ) {
2480- if (array == null ) {
2480+ if (isEmpty ( array ) ) {
24812481 return INDEX_NOT_FOUND ;
24822482 }
24832483 for (int i = max0 (startIndex ); i < array .length ; i ++) {
@@ -2647,7 +2647,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
26472647 * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input.
26482648 */
26492649 public static int indexOf (final int [] array , final int valueToFind , final int startIndex ) {
2650- if (array == null ) {
2650+ if (isEmpty ( array ) ) {
26512651 return INDEX_NOT_FOUND ;
26522652 }
26532653 for (int i = max0 (startIndex ); i < array .length ; i ++) {
@@ -2687,7 +2687,7 @@ public static int indexOf(final long[] array, final long valueToFind) {
26872687 * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input.
26882688 */
26892689 public static int indexOf (final long [] array , final long valueToFind , final int startIndex ) {
2690- if (array == null ) {
2690+ if (isEmpty ( array ) ) {
26912691 return INDEX_NOT_FOUND ;
26922692 }
26932693 for (int i = max0 (startIndex ); i < array .length ; i ++) {
@@ -2727,7 +2727,7 @@ public static int indexOf(final Object[] array, final Object objectToFind) {
27272727 * @return the index of the object within the array starting at the index, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input.
27282728 */
27292729 public static int indexOf (final Object [] array , final Object objectToFind , int startIndex ) {
2730- if (array == null ) {
2730+ if (isEmpty ( array ) ) {
27312731 return INDEX_NOT_FOUND ;
27322732 }
27332733 startIndex = max0 (startIndex );
@@ -2776,7 +2776,7 @@ public static int indexOf(final short[] array, final short valueToFind) {
27762776 * @return the index of the value within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input.
27772777 */
27782778 public static int indexOf (final short [] array , final short valueToFind , final int startIndex ) {
2779- if (array == null ) {
2779+ if (isEmpty ( array ) ) {
27802780 return INDEX_NOT_FOUND ;
27812781 }
27822782 for (int i = max0 (startIndex ); i < array .length ; i ++) {
@@ -6349,10 +6349,9 @@ public static <T> T[] removeElements(final T[] array, final T... values) {
63496349 * @param array the array to reverse, may be {@code null}.
63506350 */
63516351 public static void reverse (final boolean [] array ) {
6352- if (array = = null ) {
6353- return ;
6352+ if (array ! = null ) {
6353+ reverse ( array , 0 , array . length ) ;
63546354 }
6355- reverse (array , 0 , array .length );
63566355 }
63576356
63586357 /**
0 commit comments