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

Brian Burkhalter bpb at openjdk.java.net
Tue Feb 8 20:12:05 UTC 2022


On Tue, 8 Feb 2022 19:24:11 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: Force zero size of Long.MAX_VALUE - position; revert Windows change

Note that because of this code in the Unix `FileDispatcherImpl.c` setting `size` to `MAX_VALUE - position` is not quite the same as what is there now:

    fl.l_whence = SEEK_SET;
    if (size == (jlong)java_lang_Long_MAX_VALUE) {
        fl.l_len = (off64_t)0;
    } else {
        fl.l_len = (off64_t)size;
    }

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

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


More information about the nio-dev mailing list