Summary
Clarify the java.nio.CharBuffer specification to state that all implemented java.lang.CharSequence methods operate relative to the current buffer position.
Problem
CharBuffer implements a couple of CharSequence methods, chars() and codePoints(), but does not document that they operate with respect to the current buffer position as it does for the other overridden CharSequence methods.
Solution
Add a sentence to the class level specification clarifying that all implemented CharSequence methods operate with respect to the current buffer position.
Specification
--- a/src/java.base/share/classes/java/nio/X-Buffer.java.template
+++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template
@@ -209,6 +209,8 @@
* <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}.
+ * The methods defined by {@code CharSequence} operate relative to the current
+ * position of the buffer when they are invoked.
* </p>
*
#end[char]
- csr of
-
JDK-8065262 (bf spec) CharBuffer.chars() should make it clearer that the sequence starts from the buffer position
-
- Resolved
-