8154853: java/util/TimeZone/OldIDMappingTest.sh fails after JDK-8154231
authorredestad
Thu, 21 Apr 2016 17:21:31 +0200
changeset 37594 5aa7438a8ce1
parent 37593 824750ada3d6
child 37595 83d273e011c7
8154853: java/util/TimeZone/OldIDMappingTest.sh fails after JDK-8154231 Reviewed-by: chegar
jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java
--- a/jdk/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java	Thu Apr 21 13:39:53 2016 +0200
+++ b/jdk/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;
             }
         });
     }