JDK-8305853 : java/text/Format/DateFormat/DateFormatRegression.java fails with "Uncaught exception thrown in test method Test4089106"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2023-04-11
  • Updated: 2025-08-06
  • Resolved: 2023-04-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 21 JDK 8
11.0.30-oracleFixed 17.0.15Fixed 21 b20Fixed 8u481Fixed
Related Reports
Relates :  
Relates :  
Description
The following test failed in the JDK21 CI:

java/text/Format/DateFormat/DateFormatRegression.java

Here's a snippet from the log file:

#section:main
----------messages:(6/323)----------
command: main -Djava.locale.providers=COMPAT,SPI DateFormatRegression
reason: User specified action: run main/othervm -Djava.locale.providers=COMPAT,SPI DateFormatRegression 
started: Tue Apr 11 15:21:13 UTC 2023
Mode: othervm [/othervm specified]
finished: Tue Apr 11 15:21:14 UTC 2023
elapsed time (seconds): 0.321
----------configuration:(0/0)----------
----------System.out:(3/99)----------
DateFormatRegression {
  Test4089106 {
    Uncaught exception thrown in test method Test4089106
----------System.err:(14/854)----------
java.lang.RuntimeException: Uncaught exception thrown in test method Test4089106
	at IntlTest.errImpl(IntlTest.java:198)
	at IntlTest.errln(IntlTest.java:185)
	at IntlTest.run(IntlTest.java:126)
	at DateFormatRegression.main(DateFormatRegression.java:40)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
	at java.base/java.lang.Thread.run(Thread.java:1592)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Uncaught exception thrown in test method Test4089106
JavaTest Message: shutting down test


Hidden by the test class, the real exception thrown is:

Caused by: java.time.zone.ZoneRulesException: Unknown time-zone ID: FAKEZONE
        at java.base/java.time.zone.ZoneRulesProvider.getProvider(ZoneRulesProvider.java:281)
        at java.base/java.time.zone.ZoneRulesProvider.getRules(ZoneRulesProvider.java:236)
        at java.base/java.time.ZoneRegion.ofId(ZoneRegion.java:121)
        at java.base/java.time.ZoneId.of(ZoneId.java:411)
        at java.base/java.time.ZoneId.of(ZoneId.java:359)
        at java.base/java.time.ZoneId.of(ZoneId.java:315)
        at java.base/java.util.TimeZone.toZoneId0(TimeZone.java:605)
        at java.base/java.util.TimeZone.toZoneId(TimeZone.java:582)
        at java.base/java.util.TimeZone.toZoneId0(TimeZone.java:594)
        at java.base/java.util.TimeZone.toZoneId(TimeZone.java:582)
        at java.base/java.time.ZoneId.systemDefault(ZoneId.java:275)
        at java.base/java.time.Clock.systemDefaultZone(Clock.java:185)
        at java.base/java.time.ZonedDateTime.now(ZonedDateTime.java:201)
        at java.base/jdk.internal.logger.SimpleConsoleLogger.format(SimpleConsoleLogger.java:279)
        at java.base/jdk.internal.logger.SimpleConsoleLogger.publish(SimpleConsoleLogger.java:303)
        at java.base/jdk.internal.logger.SimpleConsoleLogger.log(SimpleConsoleLogger.java:122)
        at java.base/java.lang.System$Logger.log(System.java:1384)
        at java.base/jdk.internal.logger.AbstractLoggerWrapper.log(AbstractLoggerWrapper.java:73)
        at java.base/sun.util.locale.provider.LocaleProviderAdapter.<clinit>(LocaleProviderAdapter.java:175)
Comments
Fix request [17u] I would like to fix this test bug in 17. No risk, only a test change. Clean backport. Tests pass. SAP nighlty testing passed.
16-01-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/3213 Date: 2025-01-15 16:29:56 +0000
15-01-2025

Changeset: 8e36c05d Author: Justin Lu <jlu@openjdk.org> Date: 2023-04-26 16:53:43 +0000 URL: https://git.openjdk.org/jdk/commit/8e36c05d6c80f6bdcd8a7530a382810f500885ad
26-04-2023

A part of this issue is that the test framework `IntlTest` randomly orders the tests on Windows, which made the issue intermittent (as well as the obscure exception issue as in the description). The test framework should be refined. Filed an issue for that as JDK-8306711
24-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13630 Date: 2023-04-24 21:02:01 +0000
24-04-2023