jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
equal
deleted
inserted
replaced
43 import jdk.internal.misc.SharedSecrets; |
43 import jdk.internal.misc.SharedSecrets; |
44 |
44 |
45 import java.util.ArrayList; |
45 import java.util.ArrayList; |
46 import java.util.List; |
46 import java.util.List; |
47 |
47 |
48 import java.lang.reflect.Module; |
|
49 import java.lang.reflect.UndeclaredThrowableException; |
48 import java.lang.reflect.UndeclaredThrowableException; |
50 import java.security.PrivilegedAction; |
49 import java.security.PrivilegedAction; |
51 import java.util.Collections; |
50 import java.util.Collections; |
52 import java.util.HashMap; |
51 import java.util.HashMap; |
53 import java.util.Map; |
52 import java.util.Map; |
179 |
178 |
180 private static Class<?> loadLoggingClass(String className) { |
179 private static Class<?> loadLoggingClass(String className) { |
181 return AccessController.doPrivileged(new PrivilegedAction<>() { |
180 return AccessController.doPrivileged(new PrivilegedAction<>() { |
182 @Override |
181 @Override |
183 public Class<?> run() { |
182 public Class<?> run() { |
184 Optional<Module> logging = java.lang.reflect.Layer.boot() |
183 Optional<Module> logging = ModuleLayer.boot().findModule("java.logging"); |
185 .findModule("java.logging"); |
|
186 if (logging.isPresent()) { |
184 if (logging.isPresent()) { |
187 return Class.forName(logging.get(), className); |
185 return Class.forName(logging.get(), className); |
188 } |
186 } |
189 return null; |
187 return null; |
190 } |
188 } |