RFR: 8222329: Readable read(CharBuffer) does not specify that 0 is returned when there is no remaining space in buffer [v4]
Brian Burkhalter
bpb at openjdk.org
Fri Jun 23 15:45:24 UTC 2023
On Fri, 23 Jun 2023 06:49:31 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8222329: Correct return verbiage of Reader and CharBuffer
>
> src/java.base/share/classes/java/nio/X-Buffer.java.template line 484:
>
>> 482: * @throws ReadOnlyBufferException if target is a read only buffer,
>> 483: * even if it is empty
>> 484: * @since 1.5
>
> It might be clearer if this method linked to the length method. That way it could be specified to return 0 when the length of the target buffer is 0.
>
> For the @throws of ROBE, probably need to avoid the word "empty", only because this method writes to the target buffer, it doesn't read from the target buffer.
Addressed in 94505a45ce099faf3e31a07b8500ac456345a3b1; CSR not yet updated.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14616#discussion_r1239968591
More information about the nio-dev
mailing list