Name: gsC80088 Date: 11/24/98
In the same way as the -Stream classes, and the File class, the classes FileWriter and OutputStreamWriter (and the corresponding -Reader classes) should override finalize() to ensure that the stream is always closed when the object is finalized.
I haven't really looked into it, but the easiest way to do this might be to have their base class, Writer, provide a default implementation of finalize() which calls close().
(Review ID: 43330)
======================================================================
- relates to
-
JDK-4099999 File{Input,Output}Stream finalizer should not close FileDescriptor
-
- Closed
-
-
JDK-4081750 java.io.RandomAccessFile: Add a finalize method
-
- Closed
-
java.io.{FileWriter,OutputStreamWriter} should override finalize to call close
Name: gsC80088 Date: 11/24/98
In the same way as the -Stream classes, and the File class, the classes FileWriter and OutputStreamWriter (and the corresponding -Reader classes) should override finalize() to ensure that the stream is always closed when the object is finalized.
I haven't really looked into it, but the easiest way to do this might be to have their base class, Writer, provide a default implementation of finalize() which calls close().
(Review ID: 43330)
======================================================================
- relates to
-
JDK-4099999 File{Input,Output}Stream finalizer should not close FileDescriptor
-
- Closed
-
-
JDK-4081750 java.io.RandomAccessFile: Add a finalize method
-
- Closed
-