We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e84a79 commit 97b63a8Copy full SHA for 97b63a8
core/checksums/src/main/java/software/amazon/awssdk/checksums/internal/ConstructorCache.java
@@ -63,12 +63,17 @@ private Optional<Class<?>> getClass(String className) {
63
return Optional.empty();
64
}
65
});
66
+
67
// if the WeakReference to the class has been garbage collected, remove it from the cache and try again
- if (classRef.isPresent() && classRef.get().get() == null) {
68
+ if (classRef.isPresent()) {
69
+ Class<?> clazz = classRef.get().get();
70
+ if (clazz != null) {
71
+ return Optional.of(clazz);
72
+ }
73
classesByClassLoader.remove(classLoader);
74
return getClass(className);
75
- return classRef.map(WeakReference::get);
76
+ return Optional.empty();
77
78
79
/**
0 commit comments