RFR: JDK-8272984: javadoc support for reproducible builds [v2]

Jonathan Gibbons jjg at openjdk.java.net
Mon Jan 24 19:07:13 UTC 2022


On Mon, 24 Jan 2022 15:41:31 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

>> Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   change allowable date range to within 10 years of the time of use
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties line 433:
> 
>> 431: doclet.usage.date.description=\
>> 432:     Specifies the value to be used to timestamp the generated\n\
>> 433:     pages, in ISO_ZONED_DATE_TIME format
> 
> I guess it is technically correct to use  a `DateTimeFormatter` constant name here, but wouldn't it be better form to use a generic term like "ISO-8601 format"?

Yeah, you're right, that would be better, and sufficient.

> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java line 370:
> 
>> 368:                         try {
>> 369:                             date = ZonedDateTime.parse(arg, DateTimeFormatter.ISO_ZONED_DATE_TIME)
>> 370:                                     .withZoneSameInstant(ZoneOffset.UTC);
> 
> I notice that the new option takes a date-time with timezone, but the timezone is discarded here (and the date-time is later converted to a java.util.Date). Since the purpose of this change is to enable reproducible builds, I guess it should be possible to define the timezone used in the "Generated by" comment (which as far as I can tell is the timezone of the local host).

I went out of my way to ensure that the _output_ form was not affected, in case there is anyone relying on the existing format ... and yes, we have tests for that as well.

I'd be open to formally changing the format of the output timestamp, but I think that should be a separate RFE.

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

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


More information about the javadoc-dev mailing list