-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.2.0
-
generic
-
generic
If I issue a PrintWriter.print() where the PrintWriter is based on a ByteArrayOutputStream and that stream is closed, I see the following exception:
Exception in thread "main" java.lang.RuntimeException: Stream closed
at java.io.ByteArrayOutputStream.ensureOpen(Compiled Code)
at java.io.ByteArrayOutputStream.write(Compiled Code)
at java.io.OutputStreamWriter.flushBuffer(Compiled Code)
at java.io.OutputStreamWriter.flush(Compiled Code)
at java.io.BufferedWriter.flush(Compiled Code)
at java.io.PrintWriter.flush(Compiled Code)
at java.io.PrintWriter.checkError(Compiled Code)
at bugDemo.main(Compiled Code)
This is new behavior in the JDK1.2 This same program did not throw an exception in JDK1.1 (see also bug 4153007, which fixed a different symptom related to this same operation).
Exception in thread "main" java.lang.RuntimeException: Stream closed
at java.io.ByteArrayOutputStream.ensureOpen(Compiled Code)
at java.io.ByteArrayOutputStream.write(Compiled Code)
at java.io.OutputStreamWriter.flushBuffer(Compiled Code)
at java.io.OutputStreamWriter.flush(Compiled Code)
at java.io.BufferedWriter.flush(Compiled Code)
at java.io.PrintWriter.flush(Compiled Code)
at java.io.PrintWriter.checkError(Compiled Code)
at bugDemo.main(Compiled Code)
This is new behavior in the JDK1.2 This same program did not throw an exception in JDK1.1 (see also bug 4153007, which fixed a different symptom related to this same operation).
- relates to
-
JDK-4177581 java.io.ByteArray{Input,Output}Stream,StringWriter: Wrong exception if closed
-
- Closed
-