RFR: 5041655: (ch) FileLock: negative param and overflow issues [v7]
Brian Burkhalter
bpb at openjdk.java.net
Fri Feb 11 15:27:05 UTC 2022
On Fri, 11 Feb 2022 10:22:15 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 5041655: Further refinement of zero size lock specification
>
> src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java line 429:
>
>> 427: * {@link #lock(Object,CompletionHandler)} method simply locks a region
>> 428: * of size {@link Long#MAX_VALUE}. If a lock is created with a valid
>> 429: * {@code position} and a {@code size} parameter of zero, then a lock of
>
> I think we've got the javadoc change to a good place. One minor point is that "created with a valid position" may be a bit confusing as you can't create a lock with an invalid position. What would you think of "If the position is non-negative and the size is zero then a lock of size ...".
That would likely be better; will change.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7254
More information about the nio-dev
mailing list