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 2023/10/23 11:28:08 UTC
[commons-crypto] 01/02: Rename private var
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-crypto.git
commit c97137e168ab737bd984ab1fcef15f82e4cc9041
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Oct 23 07:27:02 2023 -0400
Rename private var
---
.../org/apache/commons/crypto/utils/ReflectionUtils.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java b/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
index e941dee..a9802be 100644
--- a/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
+++ b/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
@@ -46,11 +46,11 @@ public final class ReflectionUtils {
private static final Map<ClassLoader, Map<String, WeakReference<Class<?>>>> CACHE_CLASSES = new WeakHashMap<>();
private static final ConcurrentMap<ClassLoader, Set<String>> INIT_ERROR_CLASSES = new ConcurrentHashMap<>();
- private static final ClassLoader CLASSLOADER;
+ private static final ClassLoader CLASS_LOADER;
static {
final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader();
- CLASSLOADER = threadClassLoader != null ? threadClassLoader : CryptoCipher.class.getClassLoader();
+ CLASS_LOADER = threadClassLoader != null ? threadClassLoader : CryptoCipher.class.getClassLoader();
}
/**
@@ -68,7 +68,7 @@ public final class ReflectionUtils {
public static Class<?> getClassByName(final String name) throws ClassNotFoundException {
final Class<?> ret = getClassByNameOrNull(name);
if (ret == null) {
- if (INIT_ERROR_CLASSES.get(CLASSLOADER).contains(name)) {
+ if (INIT_ERROR_CLASSES.get(CLASS_LOADER).contains(name)) {
throw new IllegalStateException("Class " + name + " initialization error");
}
throw new ClassNotFoundException("Class " + name + " not found");
@@ -85,7 +85,7 @@ public final class ReflectionUtils {
*/
private static Class<?> getClassByNameOrNull(final String name) {
final Set<String> set =
- INIT_ERROR_CLASSES.computeIfAbsent(CLASSLOADER, k -> Collections.synchronizedSet(new HashSet<>()));
+ INIT_ERROR_CLASSES.computeIfAbsent(CLASS_LOADER, k -> Collections.synchronizedSet(new HashSet<>()));
if (set.contains(name)) {
return null;
@@ -94,7 +94,7 @@ public final class ReflectionUtils {
final Map<String, WeakReference<Class<?>>> map;
synchronized (CACHE_CLASSES) {
- map = CACHE_CLASSES.computeIfAbsent(CLASSLOADER, k -> Collections.synchronizedMap(new WeakHashMap<>()));
+ map = CACHE_CLASSES.computeIfAbsent(CLASS_LOADER, k -> Collections.synchronizedMap(new WeakHashMap<>()));
}
Class<?> clazz = null;
@@ -105,7 +105,7 @@ public final class ReflectionUtils {
if (clazz == null) {
try {
- clazz = Class.forName(name, true, CLASSLOADER);
+ clazz = Class.forName(name, true, CLASS_LOADER);
} catch (final ClassNotFoundException e) {
// Leave a marker that the class isn't found
map.put(name, new WeakReference<>(NEGATIVE_CACHE_SENTINEL));