RFR: 5041655: (ch) FileLock: negative param and overflow issues [v2]
Brian Burkhalter
bpb at openjdk.java.net
Tue Feb 8 18:07:07 UTC 2022
On Sat, 5 Feb 2022 00:17:46 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Add an implementation note to `java.nio.channels.FileLock.overlaps(long,long)` indicating that the method does not check its parameters. Adding such checks would be an incompatible change.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 5041655: Remove implNote; add special cases for negative and zero sizes; handle overflow; handle zero size on Windows; add test
I don't understand your comments about `size == 0` in the second paragraph. The changes to `FileLock::overlaps` treat zero size as effectively infinite. The change to the Windows version of `FileDispatcherImpl.c` bring it functionally in line with the Unix version, although on Windows `size` has to be promoted whereas on Unix if it is `Long.MAX_VALUE` it is changed to zero in accord with `fcntl()`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7254
More information about the nio-dev
mailing list