diff options
Diffstat (limited to 'libjava/classpath/java/nio/CharBuffer.java')
-rw-r--r-- | libjava/classpath/java/nio/CharBuffer.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libjava/classpath/java/nio/CharBuffer.java b/libjava/classpath/java/nio/CharBuffer.java index 6551555e20b..356a920eea0 100644 --- a/libjava/classpath/java/nio/CharBuffer.java +++ b/libjava/classpath/java/nio/CharBuffer.java @@ -107,14 +107,12 @@ public abstract class CharBuffer extends Buffer { // FIXME: implement better handling of java.lang.String. // Probably share data with String via reflection. - - if ((start < 0) - || (start > seq.length()) - || (end < start) - || (end > (seq.length() - start))) - throw new IndexOutOfBoundsException(); - + int len = end - start; + + if( len < 0 ) + throw new IndexOutOfBoundsException(); + char[] buffer = new char[len]; for (int i = 0; i < len; i++) |