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