-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
7u291, 8u281, 11.0.10-oracle, 15.0.2, 16
After tzdata2020b, Formatter/Basic.java reports
FAILED: '%tZ': Expected 'PST', got 'MST'
FAILED: '%tZ': Expected 'PST', got 'MST'
FAILED: '%tZ': Expected 'PST', got 'MST'
FAILED: '%TZ': Expected 'PST', got 'MST'
FAILED: '%TZ': Expected 'PST', got 'MST'
FAILED: '%TZ': Expected 'PST', got 'MST'
FAILED: '%tc': Expected 'Tue May 23 19:48:34 PST 1995', got 'Tue May 23 19:48:34 MST 1995'
FAILED: '%tc': Expected 'Tue May 23 19:48:34 PST 1995', got 'Tue May 23 19:48:34 MST 1995'
FAILED: '%tc': Expected 'Tue May 23 19:48:34 PST 1995', got 'Tue May 23 19:48:34 MST 1995'
FAILED: '%Tc': Expected 'TUE MAY 23 19:48:34 PST 1995', got 'TUE MAY 23 19:48:34 MST 1995'
FAILED: '%Tc': Expected 'TUE MAY 23 19:48:34 PST 1995', got 'TUE MAY 23 19:48:34 MST 1995'
FAILED: '%Tc': Expected 'TUE MAY 23 19:48:34 PST 1995', got 'TUE MAY 23 19:48:34 MST 1995'
Exception in thread "main" java.lang.RuntimeException: 6313 tests: 12 failure(s), first
at Basic.main(Basic.java:100)
Caused by: java.lang.RuntimeException: '%tZ': Expected 'PST', got 'MST'
at Basic.setFirst(Basic.java:64)
at Basic.fail(Basic.java:57)
at Basic.ck(Basic.java:72)
at BasicDateTime.test(BasicDateTime.java:54)
at BasicDateTime.testDateTime(BasicDateTime.java:150)
at BasicDateTime.testDateTime(BasicDateTime.java:141)
at BasicDateTime.test(BasicDateTime.java:1658)
at Basic.main(Basic.java:97)
for timezones - "America/Dawson", "America/WhiteHorse" and "Canada/Yukon".
Currently, a placeholder has been put in place so no failure is seen. But it should be investigated and fixed as the above-mentioned timezones move to MST only on 1 Nov 2020.
Here is a simple test case :
import java.util.*;
import java.lang.*;
public class Basic {
public static void main(String args[]) {
SimpleTimeZone tz = new SimpleTimeZone(-8 * 60 * 60 * 1000, "America/Dawson");
Calendar cl = new GregorianCalendar(tz, Locale.US);
cl.set(2020,10,16, 19, 48, 34);
cl.set(Calendar.MILLISECOND, 584);
Formatter f = new Formatter(new StringBuilder(), Locale.US);
f.format("%tZ", cl);
System.out.println("Short name = " + f.toString());
}
}
FAILED: '%tZ': Expected 'PST', got 'MST'
FAILED: '%tZ': Expected 'PST', got 'MST'
FAILED: '%tZ': Expected 'PST', got 'MST'
FAILED: '%TZ': Expected 'PST', got 'MST'
FAILED: '%TZ': Expected 'PST', got 'MST'
FAILED: '%TZ': Expected 'PST', got 'MST'
FAILED: '%tc': Expected 'Tue May 23 19:48:34 PST 1995', got 'Tue May 23 19:48:34 MST 1995'
FAILED: '%tc': Expected 'Tue May 23 19:48:34 PST 1995', got 'Tue May 23 19:48:34 MST 1995'
FAILED: '%tc': Expected 'Tue May 23 19:48:34 PST 1995', got 'Tue May 23 19:48:34 MST 1995'
FAILED: '%Tc': Expected 'TUE MAY 23 19:48:34 PST 1995', got 'TUE MAY 23 19:48:34 MST 1995'
FAILED: '%Tc': Expected 'TUE MAY 23 19:48:34 PST 1995', got 'TUE MAY 23 19:48:34 MST 1995'
FAILED: '%Tc': Expected 'TUE MAY 23 19:48:34 PST 1995', got 'TUE MAY 23 19:48:34 MST 1995'
Exception in thread "main" java.lang.RuntimeException: 6313 tests: 12 failure(s), first
at Basic.main(Basic.java:100)
Caused by: java.lang.RuntimeException: '%tZ': Expected 'PST', got 'MST'
at Basic.setFirst(Basic.java:64)
at Basic.fail(Basic.java:57)
at Basic.ck(Basic.java:72)
at BasicDateTime.test(BasicDateTime.java:54)
at BasicDateTime.testDateTime(BasicDateTime.java:150)
at BasicDateTime.testDateTime(BasicDateTime.java:141)
at BasicDateTime.test(BasicDateTime.java:1658)
at Basic.main(Basic.java:97)
for timezones - "America/Dawson", "America/WhiteHorse" and "Canada/Yukon".
Currently, a placeholder has been put in place so no failure is seen. But it should be investigated and fixed as the above-mentioned timezones move to MST only on 1 Nov 2020.
Here is a simple test case :
import java.util.*;
import java.lang.*;
public class Basic {
public static void main(String args[]) {
SimpleTimeZone tz = new SimpleTimeZone(-8 * 60 * 60 * 1000, "America/Dawson");
Calendar cl = new GregorianCalendar(tz, Locale.US);
cl.set(2020,10,16, 19, 48, 34);
cl.set(Calendar.MILLISECOND, 584);
Formatter f = new Formatter(new StringBuilder(), Locale.US);
f.format("%tZ", cl);
System.out.println("Short name = " + f.toString());
}
}
- relates to
-
JDK-8254177 (tz) Upgrade Timezone Data to tzdata2020b
- Resolved