From 874cc143284feb8a469e3d41e05543663cffeafb Mon Sep 17 00:00:00 2001 From: Edgar Asatryan <17509127+nstdio@users.noreply.github.com> Date: Sat, 13 Jun 2020 18:39:41 +0400 Subject: [PATCH] [LANG-1550] Optimize ArrayUtils::isArrayIndexValid method. (#551) * [LANG-1550] Optimize ArrayUtils::isArrayIndexValid method. --- .../java/org/apache/commons/lang3/ArrayUtils.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java index 87ee055cf..ee1b2157c 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java @@ -3111,6 +3111,13 @@ public static int indexOf(final int[] array, final int valueToFind) { /** * Returns whether a given array can safely be accessed at the given index. + * + *
+ * ArrayUtils.isArrayIndexValid(null, 0) = false + * ArrayUtils.isArrayIndexValid([], 0) = false + * ArrayUtils.isArrayIndexValid(["a"], 0) = true + *+ * * @param