< prev index next >

src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java

Print this page
rev 14210 : 8154231: Simplify access to System properties from JDK code
Reviewed-by: rriggs

*** 31,41 **** import jdk.internal.org.objectweb.asm.Opcodes; import jdk.internal.vm.annotation.ForceInline; import jdk.internal.misc.Unsafe; import java.lang.invoke.MethodHandles.Lookup; - import java.security.AccessController; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.function.Function; import sun.security.action.GetPropertyAction; --- 31,40 ----
*** 186,203 **** * Dump generated classes to disk, for debugging purposes. */ private static final ProxyClassesDumper DUMPER; static { ! final String strategy = AccessController.doPrivileged( ! new GetPropertyAction("java.lang.invoke.stringConcat")); ! CACHE_ENABLE = Boolean.parseBoolean(AccessController.doPrivileged( ! new GetPropertyAction("java.lang.invoke.stringConcat.cache"))); ! DEBUG = Boolean.parseBoolean(AccessController.doPrivileged( ! new GetPropertyAction("java.lang.invoke.stringConcat.debug"))); ! final String dumpPath = AccessController.doPrivileged( ! new GetPropertyAction("java.lang.invoke.stringConcat.dumpClasses")); STRATEGY = (strategy == null) ? DEFAULT_STRATEGY : Strategy.valueOf(strategy); CACHE = CACHE_ENABLE ? new ConcurrentHashMap<>() : null; DUMPER = (dumpPath == null) ? null : ProxyClassesDumper.getInstance(dumpPath); } --- 185,203 ---- * Dump generated classes to disk, for debugging purposes. */ private static final ProxyClassesDumper DUMPER; static { ! Properties props = GetPropertyAction.getProperties(); ! final String strategy = ! props.getProperty("java.lang.invoke.stringConcat"); ! CACHE_ENABLE = Boolean.parseBoolean( ! props.getProperty("java.lang.invoke.stringConcat.cache")); ! DEBUG = Boolean.parseBoolean( ! props.getProperty("java.lang.invoke.stringConcat.debug")); ! final String dumpPath = ! props.getProperty("java.lang.invoke.stringConcat.dumpClasses"); STRATEGY = (strategy == null) ? DEFAULT_STRATEGY : Strategy.valueOf(strategy); CACHE = CACHE_ENABLE ? new ConcurrentHashMap<>() : null; DUMPER = (dumpPath == null) ? null : ProxyClassesDumper.getInstance(dumpPath); }
< prev index next >