243 { "SST", "Pacific/Guadalcanal" }, |
243 { "SST", "Pacific/Guadalcanal" }, |
244 { "VST", "Asia/Ho_Chi_Minh" }, |
244 { "VST", "Asia/Ho_Chi_Minh" }, |
245 }; |
245 }; |
246 |
246 |
247 static { |
247 static { |
248 String oldmapping = AccessController.doPrivileged( |
248 USE_OLDMAPPING = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { |
249 new GetPropertyAction("sun.timezone.ids.oldmapping", "false")).toLowerCase(Locale.ROOT); |
249 public Boolean run() { |
250 USE_OLDMAPPING = (oldmapping.equals("yes") || oldmapping.equals("true")); |
|
251 AccessController.doPrivileged(new PrivilegedAction<Object>() { |
|
252 public Object run() { |
|
253 try { |
250 try { |
254 String libDir = System.getProperty("java.home") + File.separator + "lib"; |
251 String libDir = System.getProperty("java.home") + File.separator + "lib"; |
255 try (DataInputStream dis = new DataInputStream( |
252 try (DataInputStream dis = new DataInputStream( |
256 new BufferedInputStream(new FileInputStream( |
253 new BufferedInputStream(new FileInputStream( |
257 new File(libDir, "tzdb.dat"))))) { |
254 new File(libDir, "tzdb.dat"))))) { |
258 load(dis); |
255 load(dis); |
259 } |
256 } |
260 } catch (Exception x) { |
257 } catch (Exception x) { |
261 throw new Error(x); |
258 throw new Error(x); |
262 } |
259 } |
263 return null; |
260 String oldmapping = System.getProperty("sun.timezone.ids.oldmapping", "false") |
|
261 .toLowerCase(Locale.ROOT); |
|
262 return (oldmapping.equals("yes") || oldmapping.equals("true")); |
264 } |
263 } |
265 }); |
264 }); |
266 } |
265 } |
267 |
266 |
268 private static void addOldMapping() { |
267 private static void addOldMapping() { |