XenoAmess commented on a change in pull request #551:
URL: https://github.com/apache/commons-lang/pull/551#discussion_r439736709



##########
File path: src/main/java/org/apache/commons/lang3/ArrayUtils.java
##########
@@ -3110,19 +3110,22 @@ public static int indexOf(final short[] array, final 
short valueToFind, int star
     }
 
     /**
-     * Returns whether a given array can safely be accessed at the given index.
+     * <p>Returns whether a given array can safely be accessed at the given 
index.
+     *
+     * <pre>
+     * ArrayUtils.isArrayIndexValid(null, 0)       = false
+     * ArrayUtils.isArrayIndexValid([], 0)         = false
+     * ArrayUtils.isArrayIndexValid(["a"], 0)      = true
+     * </pre>

Review comment:
       @garydgregory 
   an example:
   ```
       /**
        * <p>Remove the last character from a String.</p>
        *
        * <p>If the String ends in {@code \r\n}, then remove both
        * of them.</p>
        *
        * <pre>
        * StringUtils.chop(null)          = null
        * StringUtils.chop("")            = ""
        * StringUtils.chop("abc \r")      = "abc "
        * StringUtils.chop("abc\n")       = "abc"
        * StringUtils.chop("abc\r\n")     = "abc"
        * StringUtils.chop("abc")         = "ab"
        * StringUtils.chop("abc\nabc")    = "abc\nab"
        * StringUtils.chop("a")           = ""
        * StringUtils.chop("\r")          = ""
        * StringUtils.chop("\n")          = ""
        * StringUtils.chop("\r\n")        = ""
        * </pre>
        *
        * @param str  the String to chop last character from, may be null
        * @return String without last character, {@code null} if null String 
input
        */
       public static String chop(final String str) {
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to