Commit e042de67 by Bryce McKinlay Committed by Bryce McKinlay

BufferedWriter (write (String, int, int)): Remove redundant bounds checks.

	* java/io/BufferedWriter (write (String, int, int)): Remove
	redundant bounds checks.
	(write (char[], int, int)): Likewise.

From-SVN: r46426
parent d9d6919e
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
* java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Handle * java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Handle
duplicate class registration with JvFail if the runtime hasn't been duplicate class registration with JvFail if the runtime hasn't been
initialized yet. 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> 2001-10-22 Tom Tromey <tromey@redhat.com>
......
...@@ -160,9 +160,6 @@ public class BufferedWriter extends Writer ...@@ -160,9 +160,6 @@ public class BufferedWriter extends Writer
*/ */
public void write (char[] buf, int offset, int len) throws IOException 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) synchronized (lock)
{ {
if (buffer == null) if (buffer == null)
...@@ -199,9 +196,6 @@ public class BufferedWriter extends Writer ...@@ -199,9 +196,6 @@ public class BufferedWriter extends Writer
*/ */
public void write (String str, int offset, int len) throws IOException 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) synchronized (lock)
{ {
if (buffer == null) if (buffer == null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment