JDK-8213888 : Release Note: Removal of finalize Methods from FileInputStream and FileOutputStream
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 12
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2018-11-14
  • Updated: 2019-07-24
  • Resolved: 2018-11-14
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` methods of `FileInputStream` and `FileOutputStream` were deprecated for removal in JDK 9. They have been removed in this release.
The` java.lang.ref.Cleaner` has been implemented since JDK 9 as the primary mechanism to close file descriptors that are no longer reachable from `FileInputStream` and `FileOutputStream`. The recommended approach to close files is to explicitly call `close` or to use `try-with-resources`.