< 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,12 +32,11 @@
 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;
+import sun.security.action.GetPropertyAction;
 
 public class StandardCharsets extends CharsetProvider {
 
     _INCLUDE_ALIASES_TABLES_
     _INCLUDE_ALIASES_MAP_

@@ -199,18 +198,10 @@
             }
         }
     }
 
     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);
-                }
-            });
+        return GetPropertyAction.getProperty(key);
     }
 
 
 }
< prev index next >