8276447: Deprecate finalization-related methods for removal

Reviewed-by: rriggs, alanb, lancea, darcy, mchung, serb, smarks, prr
This commit is contained in:
Brent Christian 2021-12-08 00:23:15 +00:00
parent 3c2951f738
commit ec7cb6d5d3
62 changed files with 156 additions and 140 deletions

View file

@ -707,8 +707,17 @@ public class Runtime {
* The method {@link System#runFinalization()} is the conventional
* and convenient means of invoking this method.
*
* @deprecated Finalization has been deprecated for removal. See
* {@link java.lang.Object#finalize} for background information and details
* about migration options.
* <p>
* When running in a JVM in which finalization has been disabled or removed,
* no objects will be pending finalization, so this method does nothing.
*
* @see java.lang.Object#finalize()
* @jls 12.6 Finalization of Class Instances
*/
@Deprecated(since="18", forRemoval=true)
public void runFinalization() {
SharedSecrets.getJavaLangRefAccess().runFinalization();
}