On Thu, 30 Mar 2023 23:20:52 GMT, Naoto Sato <na...@openjdk.org> wrote:

>> Justin Lu has updated the pull request incrementally with two additional 
>> commits since the last revision:
>> 
>>  - dayInMinWeek should range check input and throw exception
>>  - Tweak static cal builder
>
> src/java.base/share/classes/java/util/GregorianCalendar.java line 3025:
> 
>> 3023:         if (endDay > 7 || endDay < 1 || startDay > 7 || startDay < 1) {
>> 3024:             throw new IllegalArgumentException("Start day or end day 
>> is not " +
>> 3025:                     "a valid day of the week");
> 
> Sorry, I take my previous comment back. I think we can simply rely on the 
> return value from `getFirstDayOfWeek()` as it is well-checked, so no need to 
> check the input here. Otherwise the thrown IAE woudl have to end up in 
> `add()/roll()` public methods, which cannot be spec'ed with these internal 
> arguments.

No worries, that makes sense. Removed the exception.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13031#discussion_r1154683765

Reply via email to