You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/07/25 12:25:36 UTC
(commons-lang) 03/17: Use final
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 8e3d585fa5a5415f1afeaa3bbf243e6ff2b72469
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jul 25 08:10:31 2026 -0400
Use final
---
.../java/org/apache/commons/lang3/ArrayUtils.java | 48 +++++++++++-----------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java
index 8a53a088c..6d205b883 100644
--- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java
@@ -1618,14 +1618,14 @@ public static <T> T[] clone(final T[] array) {
* @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}.
* @since 3.21.0
*/
- public static boolean[] concat(boolean[]... arrays) {
+ public static boolean[] concat(final boolean[]... arrays) {
int totalLength = 0;
- for (boolean[] array : arrays) {
+ for (final boolean[] array : arrays) {
totalLength = addExact(totalLength, array);
}
final boolean[] result = new boolean[totalLength];
int currentPos = 0;
- for (boolean[] array : arrays) {
+ for (final boolean[] array : arrays) {
if (array != null && array.length > 0) {
System.arraycopy(array, 0, result, currentPos, array.length);
currentPos += array.length;
@@ -1650,14 +1650,14 @@ public static boolean[] concat(boolean[]... arrays) {
* @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}.
* @since 3.21.0
*/
- public static byte[] concat(byte[]... arrays) {
+ public static byte[] concat(final byte[]... arrays) {
int totalLength = 0;
- for (byte[] array : arrays) {
+ for (final byte[] array : arrays) {
totalLength = addExact(totalLength, array);
}
final byte[] result = new byte[totalLength];
int currentPos = 0;
- for (byte[] array : arrays) {
+ for (final byte[] array : arrays) {
if (array != null && array.length > 0) {
System.arraycopy(array, 0, result, currentPos, array.length);
currentPos += array.length;
@@ -1682,14 +1682,14 @@ public static byte[] concat(byte[]... arrays) {
* @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}.
* @since 3.21.0
*/
- public static char[] concat(char[]... arrays) {
+ public static char[] concat(final char[]... arrays) {
int totalLength = 0;
- for (char[] array : arrays) {
+ for (final char[] array : arrays) {
totalLength = addExact(totalLength, array);
}
final char[] result = new char[totalLength];
int currentPos = 0;
- for (char[] array : arrays) {
+ for (final char[] array : arrays) {
if (array != null && array.length > 0) {
System.arraycopy(array, 0, result, currentPos, array.length);
currentPos += array.length;
@@ -1714,14 +1714,14 @@ public static char[] concat(char[]... arrays) {
* @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}.
* @since 3.21.0
*/
- public static double[] concat(double[]... arrays) {
+ public static double[] concat(final double[]... arrays) {
int totalLength = 0;
- for (double[] array : arrays) {
+ for (final double[] array : arrays) {
totalLength = addExact(totalLength, array);
}
final double[] result = new double[totalLength];
int currentPos = 0;
- for (double[] array : arrays) {
+ for (final double[] array : arrays) {
if (array != null && array.length > 0) {
System.arraycopy(array, 0, result, currentPos, array.length);
currentPos += array.length;
@@ -1746,14 +1746,14 @@ public static double[] concat(double[]... arrays) {
* @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}.
* @since 3.21.0
*/
- public static float[] concat(float[]... arrays) {
+ public static float[] concat(final float[]... arrays) {
int totalLength = 0;
- for (float[] array : arrays) {
+ for (final float[] array : arrays) {
totalLength = addExact(totalLength, array);
}
final float[] result = new float[totalLength];
int currentPos = 0;
- for (float[] array : arrays) {
+ for (final float[] array : arrays) {
if (array != null && array.length > 0) {
System.arraycopy(array, 0, result, currentPos, array.length);
currentPos += array.length;
@@ -1778,14 +1778,14 @@ public static float[] concat(float[]... arrays) {
* @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}.
* @since 3.21.0
*/
- public static int[] concat(int[]... arrays) {
+ public static int[] concat(final int[]... arrays) {
int totalLength = 0;
- for (int[] array : arrays) {
+ for (final int[] array : arrays) {
totalLength = addExact(totalLength, array);
}
final int[] result = new int[totalLength];
int currentPos = 0;
- for (int[] array : arrays) {
+ for (final int[] array : arrays) {
if (array != null && array.length > 0) {
System.arraycopy(array, 0, result, currentPos, array.length);
currentPos += array.length;
@@ -1810,14 +1810,14 @@ public static int[] concat(int[]... arrays) {
* @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}.
* @since 3.21.0
*/
- public static long[] concat(long[]... arrays) {
+ public static long[] concat(final long[]... arrays) {
int totalLength = 0;
- for (long[] array : arrays) {
+ for (final long[] array : arrays) {
totalLength = addExact(totalLength, array);
}
final long[] result = new long[totalLength];
int currentPos = 0;
- for (long[] array : arrays) {
+ for (final long[] array : arrays) {
if (array != null && array.length > 0) {
System.arraycopy(array, 0, result, currentPos, array.length);
currentPos += array.length;
@@ -1842,14 +1842,14 @@ public static long[] concat(long[]... arrays) {
* @throws IllegalArgumentException if total arrays length exceed {@link ArrayUtils#SAFE_MAX_ARRAY_LENGTH}.
* @since 3.21.0
*/
- public static short[] concat(short[]... arrays) {
+ public static short[] concat(final short[]... arrays) {
int totalLength = 0;
- for (short[] array : arrays) {
+ for (final short[] array : arrays) {
totalLength = addExact(totalLength, array);
}
final short[] result = new short[totalLength];
int currentPos = 0;
- for (short[] array : arrays) {
+ for (final short[] array : arrays) {
if (array != null && array.length > 0) {
System.arraycopy(array, 0, result, currentPos, array.length);
currentPos += array.length;