Skip to content

Commit 4746f58

Browse files
committed
Merge branch '6.0.x'
# Conflicts: # gradle.properties
2 parents 4639738 + 54c4f1b commit 4746f58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ class ContextTypeMatchClassLoader extends DecoratingClassLoader implements Smart
5555
// override classes that have not been loaded yet. If not accessible, we will
5656
// always override requested classes, even when the classes have been loaded
5757
// by the parent ClassLoader already and cannot be transformed anymore anyway.
58-
Method method = null;
58+
Method method;
5959
try {
6060
method = ClassLoader.class.getDeclaredMethod("findLoadedClass", String.class);
6161
ReflectionUtils.makeAccessible(method);
6262
}
6363
catch (Throwable ex) {
6464
// Typically a JDK 9+ InaccessibleObjectException...
6565
// Avoid through JVM startup with --add-opens=java.base/java.lang=ALL-UNNAMED
66+
method = null;
6667
LogFactory.getLog(ContextTypeMatchClassLoader.class).debug(
6768
"ClassLoader.findLoadedClass not accessible -> will always override requested class", ex);
6869
}

0 commit comments

Comments
 (0)