RFR: 5041655: (ch) FileLock: negative param and overflow issues [v2]

Brian Burkhalter bpb at openjdk.java.net
Tue Feb 8 18:24:04 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 can change it as suggested. Note that the extant Unix version for size zero creates a lock where `size()` returns zero while in reality locking the whole file.

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

PR: https://git.openjdk.java.net/jdk/pull/7254


More information about the nio-dev mailing list