<i18n dev> RFR: 8285838: DST not applying properly with zone id offset set with TZ env variable [v5]

Naoto Sato naoto at openjdk.java.net
Tue May 31 22:37:52 UTC 2022


On Tue, 31 May 2022 20:10:44 GMT, Gaurav Chaudhari <duke at openjdk.java.net> wrote:

>> This fix ensures that when a lookup for a custom TZ code fails, and an attempt is made to find the GMT offset in order to get the current time, Daylight savings rules are applied correctly.
>
> Gaurav Chaudhari has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8285838: Corrected month comparison check for TZ DST

I tried out your patch on my local Linux machine, but the new test failed with the following exception:

ACTION: main -- Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Expected to get exit value of [0]
REASON: User specified action: run main/othervm CustomTzIDCheckDST 
TIME:   1.564 seconds
messages:
command: main CustomTzIDCheckDST
reason: User specified action: run main/othervm CustomTzIDCheckDST 
Mode: othervm [/othervm specified]
elapsed time (seconds): 1.564
configuration:
STDOUT:
Command line: [/home/nsato/projects/jdk/git/jdk/build/linux-x64/images/jdk/bin/java -cp /home/nsato/projects/jdk/git/jdk/build/linux-x64/test-support/jtreg_open_test_jdk_java_util_TimeZone/classes/0/java/util/TimeZone/CustomTzIDCheckDST.d:/home/nsato/projects/jdk/git/jdk/open/test/jdk/java/util/TimeZone:/home/nsato/projects/jdk/git/jdk/build/linux-x64/test-support/jtreg_open_test_jdk_java_util_TimeZone/classes/0/test/lib:/home/nsato/projects/jdk/git/jdk/open/test/lib:/var/tmp/jib-nsato/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/javatest.jar:/var/tmp/jib-nsato/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/jtreg.jar CustomTzIDCheckDST runTZTest ]
[2022-05-31T22:27:05.958567816Z] Gathering output for process 14771
[2022-05-31T22:27:06.635595481Z] Waiting for completion for process 14771
[2022-05-31T22:27:06.635976964Z] Waiting for completion finished for process 14771
Output and diagnostic info for process 14771 was saved into 'pid-14771-output.log'
[2022-05-31T22:27:06.663087767Z] Waiting for completion for process 14771
[2022-05-31T22:27:06.663360403Z] Waiting for completion finished for process 14771
[2022-05-31T22:27:06.663754609Z] Waiting for completion for process 14771
[2022-05-31T22:27:06.663869034Z] Waiting for completion finished for process 14771
STDERR:
 stdout: [];
 stderr: [Exception in thread "main" java.time.DateTimeException: Invalid ID for offset-based ZoneId: GMT-22:00
	at java.base/java.time.ZoneId.ofWithPrefix(ZoneId.java:436)
	at java.base/java.time.ZoneId.of(ZoneId.java:406)
	at java.base/java.time.ZoneId.of(ZoneId.java:358)
	at java.base/java.time.ZoneId.of(ZoneId.java:314)
	at java.base/java.util.TimeZone.toZoneId0(TimeZone.java:581)
	at java.base/java.util.TimeZone.toZoneId(TimeZone.java:558)
	at java.base/java.util.TimeZone.toZoneId0(TimeZone.java:570)
	at java.base/java.util.TimeZone.toZoneId(TimeZone.java:558)
	at java.base/java.time.ZoneId.systemDefault(ZoneId.java:274)
	at CustomTzIDCheckDST.runTZTest(CustomTzIDCheckDST.java:64)
	at CustomTzIDCheckDST.main(CustomTzIDCheckDST.java:51)
Caused by: java.time.DateTimeException: Zone offset hours not in valid range: value -22 is not in the range -18 to 18
	at java.base/java.time.ZoneOffset.validate(ZoneOffset.java:373)
	at java.base/java.time.ZoneOffset.ofHoursMinutesSeconds(ZoneOffset.java:326)
	at java.base/java.time.ZoneOffset.of(ZoneOffset.java:257)
	at java.base/java.time.ZoneId.ofWithPrefix(ZoneId.java:430)
	... 10 more
]
 exitValue = 1

java.lang.RuntimeException: Expected to get exit value of [0]

	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:489)
	at CustomTzIDCheckDST.main(CustomTzIDCheckDST.java:49)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:1585)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Expected to get exit value of [0]

JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Expected to get exit value of [0]

-------------

PR: https://git.openjdk.java.net/jdk/pull/8661


More information about the i18n-dev mailing list