Details

    • Type: Bug
    • Status: In Progress
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Understanding:
      Fix Understood

      Description

      Finalizers are inherently problematic and their use can lead to performance issues,
      deadlocks, hangs, and other problematic behavior.

      Furthermore the timing of finalization is unpredictable with no guarantee that a finalizer will be called.
      Classes whose instances hold non-heap resources should provide a method
      to enable explicit release of those resources, and they should also implement
      java.lang.AutoCloseable if appropriate.

      The java.lang.ref.Cleaner and java.lang.ref.PhantomReference provide more flexible and
      efficient ways to release resources when an object becomes unreachable.

        Issue Links

          Activity

          Hide
          rriggs Roger Riggs added a comment -
          For JDK 9, it is proposed to deprecate Object.finalize and methods that override it within the JDK .
          Compilation warnings will be suppressed on current uses within the JDK.

          Future work will be to re-mediate or remove uses of finalize.
          Show
          rriggs Roger Riggs added a comment - For JDK 9, it is proposed to deprecate Object.finalize and methods that override it within the JDK . Compilation warnings will be suppressed on current uses within the JDK. Future work will be to re-mediate or remove uses of finalize.
          Show
          rriggs Roger Riggs added a comment - - edited Review thread:     http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-March/046650.html Webrev:      http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate-8165641/

            People

            • Assignee:
              rriggs Roger Riggs
              Reporter:
              rriggs Roger Riggs
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Due:
                Created:
                Updated: