--- a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template Thu Apr 21 14:56:40 2016 +0800
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template Thu Apr 21 13:39:53 2016 +0200
@@ -34,8 +34,7 @@
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 {
@@ -201,15 +200,7 @@
}
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);
}