-
Bug
-
Resolution: Fixed
-
P3
-
8u92, 9
-
b130
The boundaries of LocalDate.ofEpochDay(long) are not correctly checked. In addition, the boundaries specified by ChronoField.EPOCH_DAY are wrong.
The following line must be added as the first line of LocalDate.ofEpochDay(long):
EPOCH_DAY.checkValidValue(epochDay);
The declaration of ChronoField.EPOCH_DAY must be changed to the following:
EPOCH_DAY("EpochDay", DAYS, FOREVER, ValueRange.of(-365243219162L, 365241780471L)),
Tests should be added to ensure that an exception is thrown when ofEpochDay() is invoked with an out of range value.
The following line must be added as the first line of LocalDate.ofEpochDay(long):
EPOCH_DAY.checkValidValue(epochDay);
The declaration of ChronoField.EPOCH_DAY must be changed to the following:
EPOCH_DAY("EpochDay", DAYS, FOREVER, ValueRange.of(-365243219162L, 365241780471L)),
Tests should be added to ensure that an exception is thrown when ofEpochDay() is invoked with an out of range value.