8065262: (bf spec) CharBuffer.chars() should make it clearer that the sequence starts from the buffer position

Alan Bateman Alan.Bateman at oracle.com
Fri Feb 15 09:06:54 UTC 2019

On 14/02/2019 22:36, Brian Burkhalter wrote:
> https://bugs.openjdk.java.net/browse/JDK-8065262
> One possibility would be to update the class level specification as
> To clear this up, perhaps a sentence could merely be added to the 
> specification of CharBuffer in X-Buffer.java.template:
> #if[char]
>  *
>   * <p> This class implements the {@link CharSequence} interface so that
>   * character buffers may be used wherever character sequences are 
> accepted, for
>   * example in the regular-expression package {@link java.util.regex}.
> + * {@code CharSequence} methods operate relative to the current 
> position of
> + * the buffer when they are invoked.
>   * </p>
>  *
> #end[char]
I agree that adding a statement class description will help (and avoid 
bug reports like this). Your looks okay and is consistent with the 
wording in the method description. A small suggestion is to start with 
"The methods defined by CharSequence ...".


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190215/3e48c708/attachment-0001.html>

More information about the nio-dev mailing list