JDK-8146389 : java/util/logging/XMLFormatterDate.java fails during year switch
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-01-04
  • Updated: 2016-07-15
  • Resolved: 2016-05-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 9
9 b121Fixed
Related Reports
Relates :  
Description
java/util/logging/XMLFormatterDate.java

This test fail during year switch, see log:

----------System.out:(10/219)----------
<record>
  <date>2016-01-01T00:18:08.372692Z</date>
  <millis>1451607488372</millis>
  <nanos>692000</nanos>
  <sequence>1000</sequence>
  <level>INFO</level>
  <thread>534</thread>
  <message>test</message>
</record>

----------System.err:(22/849)----------
java.lang.Error: Expected year 2015 not found in log:
<record>
  <date>2016-01-01T00:18:08.372692Z</date>
  <millis>1451607488372</millis>
  <nanos>692000</nanos>
  <sequence>1000</sequence>
  <level>INFO</level>
  <thread>534</thread>
  <message>test</message>
</record>

	at XMLFormatterDate.main(XMLFormatterDate.java:93)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:520)
	at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:218)
	at java.lang.Thread.run(Thread.java:747)

JavaTest Message: Test threw exception: java.lang.Error
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.Error: Expected year 2015 not found in log: <record> <date>2016-01-01T00:18:08.372692Z</date> <millis>1451607488372</millis> <nanos>692000</nanos> <sequence>1000</sequence> <level>INFO</level> <thread>534</thread> <message>test</message> </record>


Comments
JDK-8072645 changed the default date formatting in XML to simply use the DateTimeFormatter.ISO_INSTANT and format the date in the GMT time zone. The test was written at a time where the formatting was made in the default time zone. There's a boolean property that allows an application to configure the XML formatter to print the date in the default time zone like before. The test should be altered to take the new behaviour into account. see JDK-8072645 and associated release notes.
23-05-2016