Commit bc5863df authored by Stephane Nicoll's avatar Stephane Nicoll

Do not attempt to clear ResourceManager's cache with Java9

Closes gh-10927
parent d6fe4b9a
...@@ -46,6 +46,7 @@ import org.springframework.boot.devtools.restart.FailureHandler.Outcome; ...@@ -46,6 +46,7 @@ import org.springframework.boot.devtools.restart.FailureHandler.Outcome;
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFiles; import org.springframework.boot.devtools.restart.classloader.ClassLoaderFiles;
import org.springframework.boot.devtools.restart.classloader.RestartClassLoader; import org.springframework.boot.devtools.restart.classloader.RestartClassLoader;
import org.springframework.boot.logging.DeferredLog; import org.springframework.boot.logging.DeferredLog;
import org.springframework.boot.system.JavaVersion;
import org.springframework.cglib.core.ClassNameReader; import org.springframework.cglib.core.ClassNameReader;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.GenericApplicationContext; import org.springframework.context.support.GenericApplicationContext;
...@@ -338,7 +339,9 @@ public class Restarter { ...@@ -338,7 +339,9 @@ public class Restarter {
clear(ReflectionUtils.class, "declaredMethodsCache"); clear(ReflectionUtils.class, "declaredMethodsCache");
clear(AnnotationUtils.class, "findAnnotationCache"); clear(AnnotationUtils.class, "findAnnotationCache");
clear(AnnotationUtils.class, "annotatedInterfaceCache"); clear(AnnotationUtils.class, "annotatedInterfaceCache");
clear("com.sun.naming.internal.ResourceManager", "propertiesCache"); if (!JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.NINE)) {
clear("com.sun.naming.internal.ResourceManager", "propertiesCache");
}
} }
private void clear(String className, String fieldName) { private void clear(String className, String fieldName) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment