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

Brian Burkhalter bpb at openjdk.java.net
Sat Feb 5 00:23:10 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

Updates in commit 01:
1. `FileChannel` `lock()` and `tryLock()` now indicate that a lock of size zero means lock to end of file.
2. The `FileLock` constructors now also state that size zero is to end of file.
3. `FileLock.overlaps()` was revised.
4. Windows native locking functions now recognize size zero as signifying an unbounded range.
5. A test was added.

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

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


More information about the nio-dev mailing list