On Mon, 24 Jan 2022 15:32:46 GMT, Hannes Wallnöfer <hann...@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/toolkit/BaseOptions.java
>  line 359:
> 
>> 357:                     private static final ZonedDateTime now = 
>> ZonedDateTime.now();
>> 358:                     static final ZonedDateTime DATE_MIN = 
>> now.minusYears(10);
>> 359:                     static final ZonedDateTime DATE_MAX = 
>> now.plusYears(10);
> 
> What's the purpose of limiting valid dates this way?

Partly because the code on which I based this on (in the jar tool) had a range 
check, and partly because I think it makes sense to do a sanity check on the 
provided value.  The range in the jar tool was 1980-2099 which (see elsewhere) 
is an artifact of the zip spec, so I changed the range to a "reasonably broad" 
range of reasonable values.

Given that (for now) we convert internally to a `Date`, we can't accept years 
before Unix epoch, 1970, anyway, so that's another reason for the check.

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

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

Reply via email to