Skip to content

Commit ed9d43d

Browse files
committed
Make private static variables final in RandomUtils
1 parent f3be118 commit ed9d43d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ The <action> type attribute can be add,update,fix,remove.
8686
<action type="fix" dev="ggregory" due-to="Gary Gregory">Speedup CharSequenceUtils.toCharArray(CharSequence) for String input: ~1-2% improvement (essentially identical).</action>
8787
<action type="fix" dev="ggregory" due-to="Gary Gregory">Streamline StringUtils.truncate(String, int, int).</action>
8888
<action type="fix" dev="ggregory" due-to="Gary Gregory, sekharchowdary774">Fix Javadoc comma spacing #1538.</action>
89+
<action issue="LANG-1807" type="fix" dev="ggregory" due-to="Zhongxin Yan, Gary Gregory">Make private static variables final in RandomUtils.</action>
8990
<!-- ADD -->
9091
<action type="add" dev="ggregory" due-to="Gary Gregory">Add JavaVersion.JAVA_27.</action>
9192
<action type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_27.</action>

src/main/java/org/apache/commons/lang3/RandomUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@
7070
*/
7171
public class RandomUtils {
7272

73-
private static RandomUtils INSECURE = new RandomUtils(ThreadLocalRandom::current);
73+
private static final RandomUtils INSECURE = new RandomUtils(ThreadLocalRandom::current);
7474

75-
private static RandomUtils SECURE = new RandomUtils(SecureRandom::new);
75+
private static final RandomUtils SECURE = new RandomUtils(SecureRandom::new);
7676

7777
private static final Supplier<Random> SECURE_STRONG_SUPPLIER = () -> RandomUtils.SECURE_RANDOM_STRONG.get();
7878

79-
private static RandomUtils SECURE_STRONG = new RandomUtils(SECURE_STRONG_SUPPLIER);
79+
private static final RandomUtils SECURE_STRONG = new RandomUtils(SECURE_STRONG_SUPPLIER);
8080

8181
private static final ThreadLocal<SecureRandom> SECURE_RANDOM_STRONG = ThreadLocal.withInitial(() -> {
8282
try {

0 commit comments

Comments
 (0)