From 062c6241e1d8446c9f7e23cf266ed4192b9faa1a Mon Sep 17 00:00:00 2001 From: Spring Builds Date: Thu, 14 Sep 2023 08:03:11 +0000 Subject: [PATCH 1/2] Next development version (v6.0.13-SNAPSHOT) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ec61509746c6..143082df4fe1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=6.0.12-SNAPSHOT +version=6.0.13-SNAPSHOT org.gradle.caching=true org.gradle.jvmargs=-Xmx2048m From 54c4f1b226c99fb7e5363058935341b4c4ae7421 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 14 Sep 2023 16:45:16 +0200 Subject: [PATCH 2/2] Reset findLoadedClassMethod in case of makeAccessible failing Closes gh-31232 --- .../context/support/ContextTypeMatchClassLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java b/spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java index c4e228c3c1e5..998d061ca2cd 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java +++ b/spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java @@ -55,7 +55,7 @@ class ContextTypeMatchClassLoader extends DecoratingClassLoader implements Smart // override classes that have not been loaded yet. If not accessible, we will // always override requested classes, even when the classes have been loaded // by the parent ClassLoader already and cannot be transformed anymore anyway. - Method method = null; + Method method; try { method = ClassLoader.class.getDeclaredMethod("findLoadedClass", String.class); ReflectionUtils.makeAccessible(method); @@ -63,6 +63,7 @@ class ContextTypeMatchClassLoader extends DecoratingClassLoader implements Smart catch (Throwable ex) { // Typically a JDK 9+ InaccessibleObjectException... // Avoid through JVM startup with --add-opens=java.base/java.lang=ALL-UNNAMED + method = null; LogFactory.getLog(ContextTypeMatchClassLoader.class).debug( "ClassLoader.findLoadedClass not accessible -> will always override requested class", ex); }