changeset 14266:1dc37d8d667b

8154853: java/util/TimeZone/OldIDMappingTest.sh fails after JDK-8154231 Reviewed-by: chegar
author redestad
date Thu, 21 Apr 2016 17:21:31 +0200
parents 50d4d6b772d1
children 7de6f947d432
files src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java	Thu Apr 21 13:39:53 2016 +0200
+++ b/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java	Thu Apr 21 17:21:31 2016 +0200
@@ -245,8 +245,12 @@
     };
 
     static {
-        USE_OLDMAPPING = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
-            public Boolean run() {
+        String oldmapping = GetPropertyAction
+                .getProperty("sun.timezone.ids.oldmapping", "false")
+                .toLowerCase(Locale.ROOT);
+        USE_OLDMAPPING = (oldmapping.equals("yes") || oldmapping.equals("true"));
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            public Void run() {
                 try {
                     String libDir = System.getProperty("java.home") + File.separator + "lib";
                     try (DataInputStream dis = new DataInputStream(
@@ -257,9 +261,7 @@
                 } 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"));
+                return null;
             }
         });
     }