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

Alan Bateman alanb at openjdk.java.net
Tue Feb 8 18:30:05 UTC 2022


On Tue, 8 Feb 2022 18:20:51 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Note that the extant Unix version for size zero creates a lock where `size()` returns zero while in reality locking the whole file.

Right, so you end up with a FileLock that says it doesn't overlap with any other lock but it actually locks the region to the end of file. I think the inconsistencies will go if you promote 0 to MAX_VALUE-pos before create the FileLock object.

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

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


More information about the nio-dev mailing list