Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8254808

Deprecate for removal an empty finalize() methods in java.desktop module

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 16
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
      2d
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Deprecate for removal empty finalize() methods in the java.desktop module previously deprecated in JDK 9 under JDK-8165641.

      Problem

      The java.desktop module has a few implementations of the finalize() method which do nothing. We can mark these methods as "forRemoval = true".

      Solution

      The solution is to deprecate this API in jdk16 and remove it later.

      Specification

      src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
      
      @@ -757,11 +757,12 @@
             *         ensure that {@code super.finalize()} is invoked as described in
             *         {@link Object#finalize}. See the specification for {@link
             *         Object#finalize()} for further information about migration
             *         options.
             */
      -     @Deprecated(since="9")
      +     @Deprecated(since = "9", forRemoval = true)
      +     @SuppressWarnings("removal")
            protected void finalize () {
            }
      
      src/java.desktop/share/classes/java/awt/image/ColorModel.java
      
      @@ -1628,11 +1628,12 @@
             *     When overriding the {@code finalize} method, its implementation must explicitly
             *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
             *     See the specification for {@link Object#finalize()} for further
             *     information about migration options.
             */
      -     @Deprecated(since="9")
      +     @Deprecated(since = "9", forRemoval = true)
      +     @SuppressWarnings("removal")
            public void finalize() {
            }
      
      
      src/java.desktop/share/classes/java/awt/image/IndexColorModel.java
      
      @@ -1522,11 +1522,12 @@
             *     When overriding the {@code finalize} method, its implementation must explicitly
             *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
             *     See the specification for {@link Object#finalize()} for further
             *     information about migration options.
             */
      -     @Deprecated(since="9")
      +     @Deprecated(since = "9", forRemoval = true)
      +     @SuppressWarnings("removal")
            public void finalize() {
            }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serb Sergey Bylokhov
              Reporter:
              serb Sergey Bylokhov
              Reviewed By:
              Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: