[threeten-dev] Instant.MIN/MAX, LocalDate.MIN/MAX and Year.MIN/MAX_VALUE
Xueming Shen
xueming.shen at oracle.com
Sat Apr 6 00:11:39 PDT 2013
Stephen,
Webrev has been updated to saturate correctly. Is the calculation correct?
http://cr.openjdk.java.net/~sherman/jdk8_threeten/filetime/src/share/classes/java/nio/file/attribute/FileTime.java.sdiff.html
-Sherman
>
>>> Here is the "draft" of the FileTime change, comment and suggestion
>>> appreciated.
>>>
>>> http://cr.openjdk.java.net/~sherman/jdk8_threeten/filetime/
>> to(TimeUnit unit)
>> unit.convert(instant.getEpochSecond(), TimeUnit.SECONDS) +
>> unit.convert(instant.getNano(), TimeUnit.NANOSECONDS);
>> will not saturate correctly to MIN/MAX
>>
>> toMillis()
>> instant.toEpochMilli(); will throw ArithmeticException, so you'll have
>> to catch and convert to MIN/MAX.
>>
More information about the threeten-dev
mailing list