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

Inflater and Deflater should implement AutoCloseable

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs

      Description

      The Inflater and Deflater classes require the caller to call end() after use, because these objects retain references to native memory. This is clearly documented. However, there is no way to use these classes with the try-with-resources statement, because they don't implement AutoCloseable.

      These classes should implement a close() method that simply calls end(), and the classes should be retrofitted to implement AutoCloseable.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jpai Jaikiran Pai
              Reporter:
              smarks Stuart Marks
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: