From 50587e0e00b24807ac866768200b6a15a4d75ef6 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Tue, 20 Aug 2024 07:32:14 -0400 Subject: [PATCH] Better internal names --- .../java/org/apache/commons/lang3/RandomUtils.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/RandomUtils.java b/src/main/java/org/apache/commons/lang3/RandomUtils.java index 980485f1d..5344ae38c 100644 --- a/src/main/java/org/apache/commons/lang3/RandomUtils.java +++ b/src/main/java/org/apache/commons/lang3/RandomUtils.java @@ -58,11 +58,11 @@ public class RandomUtils { private static RandomUtils INSECURE = new RandomUtils(ThreadLocalRandom::current); - private static final Supplier SECURE_SUPPLIER = () -> RandomUtils.SECURE_RANDOM.get(); + private static final Supplier SECURE_STRONG_SUPPLIER = () -> RandomUtils.SECURE_RANDOM_STRONG.get(); - private static RandomUtils SECURE = new RandomUtils(SECURE_SUPPLIER); + private static RandomUtils SECURE_STRONG = new RandomUtils(SECURE_STRONG_SUPPLIER); - private static final ThreadLocal SECURE_RANDOM = ThreadLocal.withInitial(() -> { + private static final ThreadLocal SECURE_RANDOM_STRONG = ThreadLocal.withInitial(() -> { try { return SecureRandom.getInstanceStrong(); } catch (final NoSuchAlgorithmException e) { @@ -248,11 +248,11 @@ public class RandomUtils { * @since 3.16.0 */ public static RandomUtils secure() { - return SECURE; + return SECURE_STRONG; } static SecureRandom secureRandom() { - return SECURE_RANDOM.get(); + return SECURE_RANDOM_STRONG.get(); } private final Supplier random; @@ -268,7 +268,7 @@ public class RandomUtils { */ @Deprecated public RandomUtils() { - this(SECURE_SUPPLIER); + this(SECURE_STRONG_SUPPLIER); } private RandomUtils(final Supplier random) {