diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java index add450482..08f8628e4 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java @@ -643,15 +643,15 @@ public class ArrayUtils { * @param array the array to add the element to, may be {@code null} * @param index the position of the new object * @param element the object to add - * @param clss the type of the element being added + * @param clazz the type of the element being added * @return A new array containing the existing elements and the new element */ - private static Object add(final Object array, final int index, final Object element, final Class clss) { + private static Object add(final Object array, final int index, final Object element, final Class clazz) { if (array == null) { if (index != 0) { throw new IndexOutOfBoundsException("Index: " + index + ", Length: 0"); } - final Object joinedArray = Array.newInstance(clss, 1); + final Object joinedArray = Array.newInstance(clazz, 1); Array.set(joinedArray, 0, element); return joinedArray; } @@ -659,7 +659,7 @@ public class ArrayUtils { if (index > length || index < 0) { throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + length); } - final Object result = Array.newInstance(clss, length + 1); + final Object result = Array.newInstance(clazz, length + 1); System.arraycopy(array, 0, result, 0, index); Array.set(result, index, element); if (index < length) { @@ -767,15 +767,15 @@ public class ArrayUtils { */ @Deprecated public static T[] add(final T[] array, final int index, final T element) { - final Class clss; + final Class clazz; if (array != null) { - clss = getComponentType(array); + clazz = getComponentType(array); } else if (element != null) { - clss = ObjectUtils.getClass(element); + clazz = ObjectUtils.getClass(element); } else { throw new IllegalArgumentException("Array and element cannot both be null"); } - return (T[]) add(array, index, element, clss); + return (T[]) add(array, index, element, clazz); }