JDK-8212621 : Release Note: Removal of finalize Method in java.util.ZipFile/Inflator/Deflator
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 12
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2018-10-17
  • Updated: 2019-04-09
  • Resolved: 2019-01-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12Resolved
Description
The `finalize` method in `java.util.ZipFile`, `java.util.Inflator`, and `java.util.Deflator` was deprecated for removal in JDK 9 and its implementation was updated to be a no-op. The `finalize` method in `java.util.ZipFile`, `java.util.Inflator`, and `java.util.Deflator` has been removed in this release. Subclasses that override `finalize` in order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overriding `finalize` method. 

The removal of the finalize methods will expose `Object.finalize` to subclasses of `ZipFile`, `Deflater`, and `Inflater`. Compilation errors might occur on the override of `finalize` due to the change in declared exceptions. `Object.finalize` is now declared to throw `java.lang.Throwable`. Previously, only `java.io.IOException` was declared.