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

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

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 16
    • client-libs
    • None
    • 2d
    • behavioral
    • minimal
    • Java API
    • SE

      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() {
            }

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

              Created:
              Updated:
              Resolved: