8028734: test/java/util/Locale/InternationalBAT.java changes does not restore the default TimeZone
authoralanb
Wed, 20 Nov 2013 21:34:47 +0000
changeset 21830 668b2337f339
parent 21829 a3cac8b5ca51
child 21831 ccd19d2dc324
8028734: test/java/util/Locale/InternationalBAT.java changes does not restore the default TimeZone Reviewed-by: naoto
jdk/test/java/util/Locale/InternationalBAT.java
--- a/jdk/test/java/util/Locale/InternationalBAT.java	Wed Nov 20 10:00:54 2013 -0800
+++ b/jdk/test/java/util/Locale/InternationalBAT.java	Wed Nov 20 21:34:47 2013 +0000
@@ -39,11 +39,13 @@
 
     public static void main(String[] args) {
         boolean pass = true;
-        if (!testRequiredLocales()) {
-            pass = false;
-        }
-        if (!testRequiredEncodings()) {
-            pass = false;
+
+        TimeZone tz = TimeZone.getDefault();
+        try {
+            pass &= testRequiredLocales();
+            pass &= testRequiredEncodings();
+        } finally {
+            TimeZone.setDefault(tz);
         }
 
         if (!pass) {