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 ed9d43dbb Make private static variables final in RandomUtils
ed9d43dbb is described below

commit ed9d43dbb02486527c793b5e29c2f76077c91145
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Dec 22 10:49:05 2025 -0500

    Make private static variables final in RandomUtils
---
 src/changes/changes.xml                                 | 1 +
 src/main/java/org/apache/commons/lang3/RandomUtils.java | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 6f176efe6..830b25dff 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -86,6 +86,7 @@ The <action> type attribute can be add,update,fix,remove.
     <action                   type="fix" dev="ggregory" due-to="Gary 
Gregory">Speedup CharSequenceUtils.toCharArray(CharSequence) for String input: 
~1-2% improvement (essentially identical).</action>
     <action                   type="fix" dev="ggregory" due-to="Gary 
Gregory">Streamline StringUtils.truncate(String, int, int).</action>
     <action                   type="fix" dev="ggregory" due-to="Gary Gregory, 
sekharchowdary774">Fix Javadoc comma spacing #1538.</action>
+    <action issue="LANG-1807" type="fix" dev="ggregory" due-to="Zhongxin Yan, 
Gary Gregory">Make private static variables final in RandomUtils.</action>
     <!-- ADD -->
     <action                   type="add" dev="ggregory" due-to="Gary 
Gregory">Add JavaVersion.JAVA_27.</action>
     <action                   type="add" dev="ggregory" due-to="Gary 
Gregory">Add SystemUtils.IS_JAVA_27.</action>
diff --git a/src/main/java/org/apache/commons/lang3/RandomUtils.java 
b/src/main/java/org/apache/commons/lang3/RandomUtils.java
index 918f8193e..d57da7577 100644
--- a/src/main/java/org/apache/commons/lang3/RandomUtils.java
+++ b/src/main/java/org/apache/commons/lang3/RandomUtils.java
@@ -70,13 +70,13 @@
  */
 public class RandomUtils {
 
-    private static RandomUtils INSECURE = new 
RandomUtils(ThreadLocalRandom::current);
+    private static final RandomUtils INSECURE = new 
RandomUtils(ThreadLocalRandom::current);
 
-    private static RandomUtils SECURE = new RandomUtils(SecureRandom::new);
+    private static final RandomUtils SECURE = new 
RandomUtils(SecureRandom::new);
 
     private static final Supplier<Random> SECURE_STRONG_SUPPLIER = () -> 
RandomUtils.SECURE_RANDOM_STRONG.get();
 
-    private static RandomUtils SECURE_STRONG = new 
RandomUtils(SECURE_STRONG_SUPPLIER);
+    private static final RandomUtils SECURE_STRONG = new 
RandomUtils(SECURE_STRONG_SUPPLIER);
 
     private static final ThreadLocal<SecureRandom> SECURE_RANDOM_STRONG = 
ThreadLocal.withInitial(() -> {
         try {

Reply via email to