JDK-4140410 : java.io.{StringWriter,CharArrayWriter} permit I/O after close
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.2.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1998-05-20
  • Updated: 2002-08-07
  • Resolved: 2002-08-07
Related Reports
Duplicate :  
Description
After you close a StringWriter or CharArrayWriter, you can still call their I/O methods.  According to the developer, the only operations that should be allowed after these are closed are getBuffer and toString.  Otherwise, we should see an IOException.

Comments
EVALUATION Fixing this bug requires adding "throws IOException" to methods in these classes. As the API is frozen for JDK 1.2, this fix will have to wait until the next feature release. -- mr@eng 6/9/1998 Will not fix. While the current behavior is incorrect, fixing it at this late stage would risk the binary compatibility of this legacy class. -- ###@###.### 2002/5/23 Suggest to fix it in Tiger, the next feature release. JCK tests are excluded due to this bug: api/java_io/CharArrayWriter/index.html#CWCloseTest api/java_io/StringWriter/index.html#SWCloseTest ###@###.### 2002-08-06 Name: asR10047 Date: 08/07/2002 As the current behavior can not be changed without compatibility breaking I filed a javadoc bug to make it documented. ======================================================================
11-06-2004

WORK AROUND
11-06-2004

SUGGESTED FIX
11-06-2004

PUBLIC COMMENTS
10-06-2004