8231174: (fs) FileTime should have 100ns resolution (win)
Alan Bateman
Alan.Bateman at oracle.com
Sun Sep 22 17:37:39 UTC 2019
On 20/09/2019 23:16, Brian Burkhalter wrote:
> :
>
> I’ve eliminated the use of BigInteger in this patch:
> http://cr.openjdk.java.net/~bpb/8231174/webrev.01/.
>
> I verified that
>
> toWindowsTime(FileTime.from(Long.MAX_VALUE, TimeUnit.NANOSECONDS))
>
> does not overflow and that
>
> toFileTime(toWindowsTime(FileTime.from(Long.MAX_VALUE,
> TimeUnit.NANOSECONDS)))
>
> does not overflow and returns 100*(Long.MAX_VALUE/100) as one would
> expect. The value Long.MAX_VALUE nanoseconds represents about 292 years.
>
The Windows time stamps are 64-bit so my concern is that toFileTime will
convert from 100ns intervals to nanos and overflow. So I suspect an
overflow check is needed there.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190922/2e2e5d07/attachment.html>
More information about the nio-dev
mailing list