changeset 8870:ecd6c25b54ce

8028734: test/java/util/Locale/InternationalBAT.java changes does not restore the default TimeZone Reviewed-by: naoto
author alanb
date Wed, 20 Nov 2013 21:34:47 +0000
parents 90e27a47ff28
children d5d4b9a63174
files test/java/util/Locale/InternationalBAT.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/util/Locale/InternationalBAT.java	Wed Nov 20 10:00:54 2013 -0800
+++ b/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) {