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
This commit is contained in:
Bryce McKinlay 2001-10-23 06:04:58 +00:00 committed by Bryce McKinlay
parent d9d6919ebb
commit e042de67c4
2 changed files with 4 additions and 6 deletions

View File

@ -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>

View File

@ -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
*/ */
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)