RFR: JDK-8223536 jdk/javadoc/doclet/MetaTag/MetaTag.java still fails when run across midnight

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Jan 15 15:45:49 UTC 2020


Thanks for the suggestion. The old code used Calendar, but deep down in 
the impl, I see even that used Date.   Given that the requirements are 
very very low, that the code is not using any Deprecated methods on 
Date, and the difficulty of reliably testing in this area, it seemed 
like staying with Date was "good enough".

-- Jon

On 1/15/20 6:38 AM, Roger Riggs wrote:
> A bold suggestion is to switch to using java.time and move on from the 
> legacy java.Date.
> On 1/14/20 7:23 PM, Jonathan Gibbons wrote:
>> Please review a fix for a problem that occurs when a test is run 
>> across midnight.
>> Although it is difficult to confirm the root cause, and equally 
>> difficult to test, the root cause is believed to be a static final 
>> instance of java.util.Calendar that is used to obtain the date 
>> written into the generated files, and which is subsequently verified 
>> by tests. When javadoc is run multiple times in the same JVM, as will 
>> occur when running the MetaTag.java test, the static final Calendar 
>> may be initialized to a time that is outside the range checked by the 
>> test.
>> The fix is to replace the static instance by a non-static instance 
>> created in HtmlConfiguration.
>> The fix is noreg-hard, because it can only be fully tested by running 
>> within milliseconds of midnight. It's remarkable that this has 
>> actually occurred multiple times in productio build/test runs.
>> -- Jon
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8223536
>> Webrev: http://cr.openjdk.java.net/~jjg/8223536/webrev/

More information about the javadoc-dev mailing list