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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 1.2.0
    • Component/s: 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)
      ======================================================================

            Assignee:
            Mark Reinhold
            Reporter:
            Greg Stone
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: