< prev index next >

src/java.base/share/classes/java/nio/charset/Charset.java

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

*** 281,292 **** static boolean atBugLevel(String bl) { // package-private String level = bugLevel; if (level == null) { if (!VM.isBooted()) return false; ! bugLevel = level = AccessController.doPrivileged( ! new GetPropertyAction("sun.nio.cs.bugLevel", "")); } return level.equals(bl); } /** --- 281,292 ---- static boolean atBugLevel(String bl) { // package-private String level = bugLevel; if (level == null) { if (!VM.isBooted()) return false; ! bugLevel = level = ! GetPropertyAction.getProperty("sun.nio.cs.bugLevel", ""); } return level.equals(bl); } /**
*** 607,618 **** * @since 1.5 */ public static Charset defaultCharset() { if (defaultCharset == null) { synchronized (Charset.class) { ! String csn = AccessController.doPrivileged( ! new GetPropertyAction("file.encoding")); Charset cs = lookup(csn); if (cs != null) defaultCharset = cs; else defaultCharset = forName("UTF-8"); --- 607,617 ---- * @since 1.5 */ public static Charset defaultCharset() { if (defaultCharset == null) { synchronized (Charset.class) { ! String csn = GetPropertyAction.getProperty("file.encoding"); Charset cs = lookup(csn); if (cs != null) defaultCharset = cs; else defaultCharset = forName("UTF-8");
< prev index next >