jdk/src/share/classes/java/nio/StringCharBuffer.java
changeset 2593 76032557be03
parent 1224 8c1bc7c5dd00
child 5506 202f599c92aa
--- a/jdk/src/share/classes/java/nio/StringCharBuffer.java	Mon Apr 13 18:20:51 2009 -0700
+++ b/jdk/src/share/classes/java/nio/StringCharBuffer.java	Wed Apr 15 14:53:34 2009 +0100
@@ -102,10 +102,12 @@
     public final CharBuffer subSequence(int start, int end) {
         try {
             int pos = position();
-            return new StringCharBuffer(str, -1,
+            return new StringCharBuffer(str,
+                                        -1,
                                         pos + checkIndex(start, pos),
                                         pos + checkIndex(end, pos),
-                                        remaining(), offset);
+                                        capacity(),
+                                        offset);
         } catch (IllegalArgumentException x) {
             throw new IndexOutOfBoundsException();
         }