< prev index next >

src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java

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

*** 243,268 **** { "SST", "Pacific/Guadalcanal" }, { "VST", "Asia/Ho_Chi_Minh" }, }; static { ! String oldmapping = AccessController.doPrivileged( ! new GetPropertyAction("sun.timezone.ids.oldmapping", "false")).toLowerCase(Locale.ROOT); ! USE_OLDMAPPING = (oldmapping.equals("yes") || oldmapping.equals("true")); ! AccessController.doPrivileged(new PrivilegedAction<Object>() { ! public Object run() { try { String libDir = System.getProperty("java.home") + File.separator + "lib"; try (DataInputStream dis = new DataInputStream( new BufferedInputStream(new FileInputStream( new File(libDir, "tzdb.dat"))))) { load(dis); } } catch (Exception x) { throw new Error(x); } ! return null; } }); } private static void addOldMapping() { --- 243,267 ---- { "SST", "Pacific/Guadalcanal" }, { "VST", "Asia/Ho_Chi_Minh" }, }; static { ! USE_OLDMAPPING = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { ! public Boolean run() { try { String libDir = System.getProperty("java.home") + File.separator + "lib"; try (DataInputStream dis = new DataInputStream( new BufferedInputStream(new FileInputStream( new File(libDir, "tzdb.dat"))))) { load(dis); } } catch (Exception x) { throw new Error(x); } ! String oldmapping = System.getProperty("sun.timezone.ids.oldmapping", "false") ! .toLowerCase(Locale.ROOT); ! return (oldmapping.equals("yes") || oldmapping.equals("true")); } }); } private static void addOldMapping() {
< prev index next >