File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
spring-context/src/main/java/org/springframework/context/support Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,15 @@ class ContextTypeMatchClassLoader extends DecoratingClassLoader implements Smart
55
55
// override classes that have not been loaded yet. If not accessible, we will
56
56
// always override requested classes, even when the classes have been loaded
57
57
// by the parent ClassLoader already and cannot be transformed anymore anyway.
58
- Method method = null ;
58
+ Method method ;
59
59
try {
60
60
method = ClassLoader .class .getDeclaredMethod ("findLoadedClass" , String .class );
61
61
ReflectionUtils .makeAccessible (method );
62
62
}
63
63
catch (Throwable ex ) {
64
64
// Typically a JDK 9+ InaccessibleObjectException...
65
65
// Avoid through JVM startup with --add-opens=java.base/java.lang=ALL-UNNAMED
66
+ method = null ;
66
67
LogFactory .getLog (ContextTypeMatchClassLoader .class ).debug (
67
68
"ClassLoader.findLoadedClass not accessible -> will always override requested class" , ex );
68
69
}
You can’t perform that action at this time.
0 commit comments