< prev index next >

src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template

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

*** 32,43 **** import java.nio.charset.Charset; import java.nio.charset.spi.CharsetProvider; import java.util.Iterator; import java.util.Locale; import java.util.Map; ! import java.security.AccessController; ! import java.security.PrivilegedAction; public class StandardCharsets extends CharsetProvider { _INCLUDE_ALIASES_TABLES_ _INCLUDE_ALIASES_MAP_ --- 32,42 ---- import java.nio.charset.Charset; import java.nio.charset.spi.CharsetProvider; import java.util.Iterator; import java.util.Locale; import java.util.Map; ! import sun.security.action.GetPropertyAction; public class StandardCharsets extends CharsetProvider { _INCLUDE_ALIASES_TABLES_ _INCLUDE_ALIASES_MAP_
*** 199,216 **** } } } private static String getProperty(String key) { ! // this method may be called during initialization of ! // system class loader and thus not using lambda ! return AccessController.doPrivileged( ! new PrivilegedAction<String>() { ! @Override ! public String run() { ! return System.getProperty(key); ! } ! }); } } --- 198,207 ---- } } } private static String getProperty(String key) { ! return GetPropertyAction.getProperty(key); } }
< prev index next >