This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new e20874465 Refactor rename the variable name from 'clss' to 'clazz'
(#1087)
e20874465 is described below
commit e2087446516e903150df2c45eec2231dacd9f0c2
Author: 徐梦旗 <[email protected]>
AuthorDate: Sat Jul 29 01:39:07 2023 +0800
Refactor rename the variable name from 'clss' to 'clazz' (#1087)
---
src/main/java/org/apache/commons/lang3/ArrayUtils.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
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> T[] add(final T[] array, final int index, final T
element) {
- final Class<T> clss;
+ final Class<T> 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);
}