Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4192722

java.io.{FileWriter,OutputStreamWriter} should override finalize to call close

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • generic
    • generic



      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)
      ======================================================================

            mr Mark Reinhold
            gstone Greg Stone
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: