Remove the (empty) ThreadPoolExecutor.finalize() method

XMLWordPrintable

    • Type: CSR
    • Resolution: Unresolved
    • Priority: P4
    • 26
    • Component/s: core-libs
    • None
    • source, binary
    • minimal
    • Hide
      This change should have no compatibility impact, given the continued presence of the Object.finalize() method, which ThreadPoolExecutor inherits. Subclasses that @Override finalize, call super.finalize() or call finalize() directly will continue to compile and execute.
      Show
      This change should have no compatibility impact, given the continued presence of the Object.finalize() method, which ThreadPoolExecutor inherits. Subclasses that @Override finalize, call super.finalize() or call finalize() directly will continue to compile and execute.
    • Java API

      Summary

      ThreadPoolExecutor.finalize() was (re)specified to do nothing in JDK 11. All finalize methods (along with the finalization mechanism itself) were deprecated for removal with JEP 421 in JDK 18.

      Problem

      The vestigial ThreadPoolExecutor.finalize() method serves no purpose, and recently caused a minor annoyance in test code (JDK-8371682).

      Solution

      The finalizer in ThreadPoolExecutor can be removed safely.

      Specification

      The spec change is best viewed in the attached specdiff, as the method spec is generated from verbiage inherited from Object.finalize(), plus local @implNote.

            Assignee:
            Brent Christian
            Reporter:
            Brent Christian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: