]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
BufferedWriter (write (String, int, int)): Remove redundant bounds checks.
authorBryce McKinlay <bryce@waitaki.otago.ac.nz>
Tue, 23 Oct 2001 06:04:58 +0000 (06:04 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Tue, 23 Oct 2001 06:04:58 +0000 (07:04 +0100)
* java/io/BufferedWriter (write (String, int, int)): Remove
redundant bounds checks.
(write (char[], int, int)): Likewise.

From-SVN: r46426

libjava/ChangeLog
libjava/java/io/BufferedWriter.java

index ef44abaee11f0a866123b78db229fae1691a6913..bdd60919c1ee6e40a7865119775f3b8bb675149d 100644 (file)
@@ -7,6 +7,10 @@
        * java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Handle
        duplicate class registration with JvFail if the runtime hasn't been
        initialized yet.
+       
+       * java/io/BufferedWriter (write (String, int, int)): Remove redundant 
+       bounds checks.
+       (write (char[], int, int)): Likewise.
 
 2001-10-22  Tom Tromey  <tromey@redhat.com>
 
index ef12bd56745e41a4548e49edc1ee29189cd840ca..371c496c7c3798dd03abf2425d0bcdfb97bb7224 100644 (file)
@@ -160,9 +160,6 @@ public class BufferedWriter extends Writer
    */
   public void write (char[] buf, int offset, int len) throws IOException
   {
-    if (offset < 0 || len < 0 || offset + len > buf.length)
-      throw new ArrayIndexOutOfBoundsException ();
-
     synchronized (lock)
       {
        if (buffer == null)
@@ -199,9 +196,6 @@ public class BufferedWriter extends Writer
    */
   public void write (String str, int offset, int len) throws IOException
   {
-    if (offset < 0 || len < 0 || offset + len > str.length())
-      throw new ArrayIndexOutOfBoundsException ();
-
     synchronized (lock)
       {
        if (buffer == null)