-
CSR
-
Resolution: Approved
-
P4
-
None
-
source, binary, behavioral
-
low
-
Some of the methods are "public", while the default access level of "finalize" method is "protected".
-
Java API
-
SE
Summary
The "java.desktop" module has a few implementations of the finalize() which do nothing, deprecated since Java 9, and are marked "forRemoval = true" since Java 16.
Solution
Delete three "finalize()" methods.
Specification
src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
- /**
- * Frees the resources associated with an {@code ICC_Profile} object.
- *
- * @deprecated The {@code finalize} method has been deprecated. Subclasses
- * that override {@code finalize} in order to perform cleanup should
- * be modified to use alternative cleanup mechanisms and to remove
- * the overriding {@code finalize} method. 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", forRemoval = true)
- @SuppressWarnings("removal")
- protected void finalize() {
- }
src/java.desktop/share/classes/java/awt/image/ColorModel.java
- /**
- * Disposes of system resources associated with this
- * {@code ColorModel} once this {@code ColorModel} is no
- * longer referenced.
- *
- * @deprecated The {@code finalize} method has been deprecated.
- * Subclasses that override {@code finalize} in order to perform cleanup
- * should be modified to use alternative cleanup mechanisms and
- * to remove the overriding {@code finalize} method.
- * 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", forRemoval = true)
- @SuppressWarnings("removal")
- public void finalize() {
- }
src/java.desktop/share/classes/java/awt/image/IndexColorModel.java
- /**
- * Disposes of system resources associated with this
- * {@code ColorModel} once this {@code ColorModel} is no
- * longer referenced.
- *
- * @deprecated The {@code finalize} method has been deprecated.
- * Subclasses that override {@code finalize} in order to perform cleanup
- * should be modified to use alternative cleanup mechanisms and
- * to remove the overriding {@code finalize} method.
- * 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", forRemoval = true)
- @SuppressWarnings("removal")
- public void finalize() {
- }
Link for convenience: https://github.com/openjdk/jdk/pull/5292/files
- csr of
-
JDK-8273102 Delete deprecated for removal the empty finalize() in java.desktop module
- Resolved