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

Brian Burkhalter bpb at openjdk.java.net
Fri Feb 11 16:00:05 UTC 2022


On Fri, 11 Feb 2022 15:24:09 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> 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.

Fixed and CSR updated accordingly.

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

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


More information about the nio-dev mailing list