aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-12-02 21:30:13 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-12-02 21:30:13 +0000
commitbbc13bf693fc584139c71b91f2baa9d1a8caa87f (patch)
treed2d786a4927dc5c1cc8c2f1047c9dc5e6acdd61c /libjava
parent834572b852c02275fdf7077b5a18d82724ee7fca (diff)
downloadgcc-bbc13bf693fc584139c71b91f2baa9d1a8caa87f.zip
gcc-bbc13bf693fc584139c71b91f2baa9d1a8caa87f.tar.gz
gcc-bbc13bf693fc584139c71b91f2baa9d1a8caa87f.tar.bz2
Bug compatibility, for PR libgcj/8738:
* java/io/CharArrayWriter.java (close): Do nothing. (flush): Likewise. (reset): Don't touch `closed'. (write(int)): Don't throw IOException. (write(char[],int,int)): Likewise. (write(String,int,int)): Likewise. (closed): Removed. From-SVN: r59743
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog11
-rw-r--r--libjava/java/io/CharArrayWriter.java33
2 files changed, 16 insertions, 28 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 61e147e..894f006 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,14 @@
+2002-12-01 Tom Tromey <tromey@redhat.com>
+
+ Bug compatibility, for PR libgcj/8738:
+ * java/io/CharArrayWriter.java (close): Do nothing.
+ (flush): Likewise.
+ (reset): Don't touch `closed'.
+ (write(int)): Don't throw IOException.
+ (write(char[],int,int)): Likewise.
+ (write(String,int,int)): Likewise.
+ (closed): Removed.
+
2002-12-01 Mark Wielaard <mark@klomp.org>
* java/lang/SecurityManager.java: Remerge comments, indenting and
diff --git a/libjava/java/io/CharArrayWriter.java b/libjava/java/io/CharArrayWriter.java
index 7cf9425..6f749b4 100644
--- a/libjava/java/io/CharArrayWriter.java
+++ b/libjava/java/io/CharArrayWriter.java
@@ -1,5 +1,5 @@
/* CharArrayWriter.java -- Write chars to a buffer
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -98,19 +98,13 @@ public class CharArrayWriter extends Writer
*/
public void close ()
{
- closed = true;
}
/**
* This method flushes all buffered chars to the stream.
*/
- public void flush () throws IOException
+ public void flush ()
{
- synchronized (lock)
- {
- if (closed)
- throw new IOException ("Stream closed");
- }
}
/**
@@ -123,9 +117,6 @@ public class CharArrayWriter extends Writer
synchronized (lock)
{
count = 0;
- // Allow this to reopen the stream.
- // FIXME - what does the JDK do?
- closed = false;
}
}
@@ -187,13 +178,10 @@ public class CharArrayWriter extends Writer
*
* @param oneChar The char to be read passed as an int
*/
- public void write (int oneChar) throws IOException
+ public void write (int oneChar)
{
synchronized (lock)
{
- if (closed)
- throw new IOException ("Stream closed");
-
resize (1);
buf[count++] = (char) oneChar;
}
@@ -207,13 +195,10 @@ public class CharArrayWriter extends Writer
* @param offset The index into the buffer to start writing data from
* @param len The number of chars to write
*/
- public void write (char[] buffer, int offset, int len) throws IOException
+ public void write (char[] buffer, int offset, int len)
{
synchronized (lock)
{
- if (closed)
- throw new IOException ("Stream closed");
-
if (len >= 0)
resize (len);
System.arraycopy(buffer, offset, buf, count, len);
@@ -230,13 +215,10 @@ public class CharArrayWriter extends Writer
* @param offset The index into the string to start writing data from
* @param len The number of chars to write
*/
- public void write (String str, int offset, int len) throws IOException
+ public void write (String str, int offset, int len)
{
synchronized (lock)
{
- if (closed)
- throw new IOException ("Stream closed");
-
if (len >= 0)
resize (len);
str.getChars(offset, offset + len, buf, count);
@@ -289,9 +271,4 @@ public class CharArrayWriter extends Writer
* The number of chars that have been written to the buffer
*/
protected int count;
-
- /**
- * True if the stream has been closed.
- */
- private boolean closed;
}