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

Brian Burkhalter bpb at openjdk.java.net
Thu Feb 10 21:14:08 UTC 2022


On Thu, 10 Feb 2022 19:59:49 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> I had wondered about adding that:
>> 
>> -     * Long#MAX_VALUE}.
>> +     * Long#MAX_VALUE}.  If a lock is created with a valid {@code position}
>> +     * and a {@code size} parameter of zero, then a lock of size
>> +     * {@code Long.MAX_VALUE - position} is returned.
>
> Good.

Resolved in commit 8e0de59.

>> I think it does look better:
>> 
>> -     * @return  {@code true} if, and only if, this lock and the given lock
>> -     *          range overlap by at least one byte
>> +     * @return  {@code true} if this lock and the given lock range overlap
>> +     *          by at least one byte; {@code false} if {@code size} is
>> +     *          negative or the lock range does not overlap this lock
>
> Good.

Resolved in commit 8e0de59.

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

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


More information about the nio-dev mailing list