Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8274609 JEP 421: Deprecate Finalization for Removal
  3. JDK-8278866

Release Note: Deprecated Finalization for Removal

XMLWordPrintable

    • Verified

      The finalization mechanism has been deprecated for removal in a future release. The `finalize` methods in standard Java APIs, such as `Object.finalize()` and `Enum.finalize()`, have also been deprecated for removal in a future release, along with methods related to finalization, such as `Runtime.runFinalization()` and `System.runFinalization()`.

      Finalization remains enabled by default, but it can be disabled for testing purposes by using the command-line option `--finalization=disabled` introduced in this release. Maintainers of libraries and applications that rely upon finalization should migrate to other resource management techniques in their code, such as [try-with-resources](https://dev.java/learn/catching-and-handling-exceptions/#anchor_6) and [cleaners](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ref/Cleaner.html).

      See [JEP 421](https://openjdk.java.net/jeps/421) for further information.

            bchristi Brent Christian
            bchristi Brent Christian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: