[LANG-1569] Add ArrayUtils.get(T[], index, T) to provide an

out-of-bounds default value
This commit is contained in:
Gary Gregory 2020-06-12 16:41:10 -04:00
parent 5b699d0765
commit b2412284a3
1 changed files with 1 additions and 1 deletions

View File

@ -1678,7 +1678,7 @@ public static <T> T get(final T[] array, final int index) {
* @return the nTh element of an array or a default value if the index is out of bounds.
* @since 3.11
*/
public static <T> T get(final T[] array, final int index, T defaultValue) {
public static <T> T get(final T[] array, final int index, final T defaultValue) {
if (array == null) {
return defaultValue;
}