changeset 571:12f5110538d3

6733145: (bf) CharBuffer.subSequence can be updated to take advantage of covariant returns Summary: Change return type to CharBuffer Reviewed-by: alanb
author martin
date Tue, 09 Sep 2008 15:20:07 -0700
parents 84417fdd8358
children 2b44dd8ed72d
files src/share/classes/java/nio/ByteBufferAs-X-Buffer.java src/share/classes/java/nio/Direct-X-Buffer.java src/share/classes/java/nio/Heap-X-Buffer.java src/share/classes/java/nio/StringCharBuffer.java src/share/classes/java/nio/X-Buffer.java
diffstat 5 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/nio/ByteBufferAs-X-Buffer.java	Tue Sep 09 15:20:07 2008 -0700
+++ b/src/share/classes/java/nio/ByteBufferAs-X-Buffer.java	Tue Sep 09 15:20:07 2008 -0700
@@ -186,7 +186,7 @@
 
     // --- Methods to support CharSequence ---
 
-    public CharSequence subSequence(int start, int end) {
+    public CharBuffer subSequence(int start, int end) {
         int pos = position();
         int lim = limit();
         assert (pos <= lim);
--- a/src/share/classes/java/nio/Direct-X-Buffer.java	Tue Sep 09 15:20:07 2008 -0700
+++ b/src/share/classes/java/nio/Direct-X-Buffer.java	Tue Sep 09 15:20:07 2008 -0700
@@ -402,7 +402,7 @@
 
     // --- Methods to support CharSequence ---
 
-    public CharSequence subSequence(int start, int end) {
+    public CharBuffer subSequence(int start, int end) {
         int pos = position();
         int lim = limit();
         assert (pos <= lim);
--- a/src/share/classes/java/nio/Heap-X-Buffer.java	Tue Sep 09 15:20:07 2008 -0700
+++ b/src/share/classes/java/nio/Heap-X-Buffer.java	Tue Sep 09 15:20:07 2008 -0700
@@ -566,7 +566,7 @@
 
     // --- Methods to support CharSequence ---
 
-    public CharSequence subSequence(int start, int end) {
+    public CharBuffer subSequence(int start, int end) {
         if ((start < 0)
             || (end > length())
             || (start > end))
--- a/src/share/classes/java/nio/StringCharBuffer.java	Tue Sep 09 15:20:07 2008 -0700
+++ b/src/share/classes/java/nio/StringCharBuffer.java	Tue Sep 09 15:20:07 2008 -0700
@@ -99,7 +99,7 @@
         return str.toString().substring(start + offset, end + offset);
     }
 
-    public final CharSequence subSequence(int start, int end) {
+    public final CharBuffer subSequence(int start, int end) {
         try {
             int pos = position();
             return new StringCharBuffer(str, -1,
--- a/src/share/classes/java/nio/X-Buffer.java	Tue Sep 09 15:20:07 2008 -0700
+++ b/src/share/classes/java/nio/X-Buffer.java	Tue Sep 09 15:20:07 2008 -0700
@@ -1239,13 +1239,13 @@
      *         smaller than <tt>start</tt> and no larger than
      *         <tt>remaining()</tt>
      *
-     * @return  The new character sequence
+     * @return  The new character buffer
      *
      * @throws  IndexOutOfBoundsException
      *          If the preconditions on <tt>start</tt> and <tt>end</tt>
      *          do not hold
      */
-    public abstract CharSequence subSequence(int start, int end);
+    public abstract CharBuffer subSequence(int start, int end);
 
 
     // --- Methods to support Appendable ---