mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8276447: Deprecate finalization-related methods for removal
Reviewed-by: rriggs, alanb, lancea, darcy, mchung, serb, smarks, prr
This commit is contained in:
parent
3c2951f738
commit
ec7cb6d5d3
62 changed files with 156 additions and 140 deletions
|
@ -1922,8 +1922,18 @@ public final class System {
|
|||
* Runtime.getRuntime().runFinalization()
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* @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.Runtime#runFinalization()
|
||||
* @jls 12.6 Finalization of Class Instances
|
||||
*/
|
||||
@Deprecated(since="18", forRemoval=true)
|
||||
@SuppressWarnings("removal")
|
||||
public static void runFinalization() {
|
||||
Runtime.getRuntime().runFinalization();
|
||||
}
|
||||
|
@ -2321,7 +2331,7 @@ public final class System {
|
|||
public Thread newThreadWithAcc(Runnable target, @SuppressWarnings("removal") AccessControlContext acc) {
|
||||
return new Thread(target, acc);
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("removal")
|
||||
public void invokeFinalize(Object o) throws Throwable {
|
||||
o.finalize();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue