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 57143123d Initialize in declaration
57143123d is described below

commit 57143123dbc44fa9b9b18a51bf9ac3bfaa5512f7
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Jun 24 07:27:57 2025 -0400

    Initialize in declaration
---
 src/main/java/org/apache/commons/lang3/CharUtils.java | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/CharUtils.java 
b/src/main/java/org/apache/commons/lang3/CharUtils.java
index b82519f5c..51765655f 100644
--- a/src/main/java/org/apache/commons/lang3/CharUtils.java
+++ b/src/main/java/org/apache/commons/lang3/CharUtils.java
@@ -30,7 +30,7 @@
  */
 public class CharUtils {
 
-    private static final String[] CHAR_STRING_ARRAY = new String[128];
+    private static final String[] CHAR_STRING_ARRAY = ArrayUtils.setAll(new 
String[128], i -> String.valueOf((char) i));
 
     private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', 
'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
 
@@ -59,10 +59,6 @@ public class CharUtils {
      */
     public static final char NUL = '\0';
 
-    static {
-        ArrayUtils.setAll(CHAR_STRING_ARRAY, i -> String.valueOf((char) i));
-    }
-
     /**
      * Compares two {@code char} values numerically. This is the same 
functionality as provided in Java 7.
      *

Reply via email to