diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 0d5c0302984..fb71da38449 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +1999-11-01 Bryce McKinlay + + * java/io/PrintStream (PrintStream): Fix illegal usage of "this" + before "super". + * java/io/OutputStreamWriter (OutputStreamWriter): ditto. + * java/io/InputStreamReader (InputStreamReader): ditto. + 1999-10-22 Tom Tromey * Makefile.in: Rebuilt. diff --git a/libjava/java/io/InputStreamReader.java b/libjava/java/io/InputStreamReader.java index ae5e2c7b0eb..f8f5dec4e36 100644 --- a/libjava/java/io/InputStreamReader.java +++ b/libjava/java/io/InputStreamReader.java @@ -44,9 +44,11 @@ public class InputStreamReader extends Reader private InputStreamReader(InputStream in, BytesToUnicode decoder) { - super((this.in = (in instanceof BufferedInputStream - ? (BufferedInputStream) in - : new BufferedInputStream(in, 250)))); + this.in = in instanceof BufferedInputStream + ? (BufferedInputStream) in + : new BufferedInputStream(in, 250); + /* Don't need to call super(in) here as long as the lock gets set. */ + this.lock = in; converter = decoder; converter.setInput(this.in.buf, 0, 0); } diff --git a/libjava/java/io/OutputStreamWriter.java b/libjava/java/io/OutputStreamWriter.java index 88841d9c1b4..23a974e53da 100644 --- a/libjava/java/io/OutputStreamWriter.java +++ b/libjava/java/io/OutputStreamWriter.java @@ -32,11 +32,13 @@ public class OutputStreamWriter extends Writer private OutputStreamWriter(OutputStream out, UnicodeToBytes encoder) { - super((this.out = (out instanceof BufferedOutputStream - ? (BufferedOutputStream) out - : new BufferedOutputStream(out, 250)))); + this.out = out instanceof BufferedOutputStream + ? (BufferedOutputStream) out + : new BufferedOutputStream(out, 250); + /* Don't need to call super(out) here as long as the lock gets set. */ + this.lock = out; this.converter = encoder; - } + } public OutputStreamWriter(OutputStream out, String enc) throws UnsupportedEncodingException diff --git a/libjava/java/io/PrintStream.java b/libjava/java/io/PrintStream.java index f13d9f318bd..f024a69a0ed 100644 --- a/libjava/java/io/PrintStream.java +++ b/libjava/java/io/PrintStream.java @@ -238,9 +238,16 @@ public class PrintStream extends FilterOutputStream public PrintStream (OutputStream out, boolean af) { - super ((this.out = (out instanceof BufferedOutputStream - ? (BufferedOutputStream) out - : new BufferedOutputStream(out, 250)))); + super(out); + if (out instanceof BufferedOutputStream) + this.out = (BufferedOutputStream) out; + else + { + this.out = new BufferedOutputStream(out, 250); + /* PrintStream redefines "out". Explicitly reset FilterOutputStream's + * "out" so that they're referring to the same thing. */ + super.out = this.out; + } converter = UnicodeToBytes.getDefaultEncoder(); error = false; auto_flush = af;