8198249: Remove deprecated Runtime::runFinalizersOnExit and System::runFinalizersOnExit

Reviewed-by: dholmes, alanb, smarks
This commit is contained in:
Mandy Chung 2018-02-23 12:10:56 -08:00
parent cfe9ad4608
commit 4bb064c62d
20 changed files with 114 additions and 500 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1765,38 +1765,6 @@ public final class System {
Runtime.getRuntime().runFinalization();
}
/**
* Enable or disable finalization on exit; doing so specifies that the
* finalizers of all objects that have finalizers that have not yet been
* automatically invoked are to be run before the Java runtime exits.
* By default, finalization on exit is disabled.
*
* <p>If there is a security manager,
* its <code>checkExit</code> method is first called
* with 0 as its argument to ensure the exit is allowed.
* This could result in a SecurityException.
*
* @deprecated This method is inherently unsafe. It may result in
* finalizers being called on live objects while other threads are
* concurrently manipulating those objects, resulting in erratic
* behavior or deadlock.
* This method is subject to removal in a future version of Java SE.
* @param value indicating enabling or disabling of finalization
* @throws SecurityException
* if a security manager exists and its <code>checkExit</code>
* method doesn't allow the exit.
*
* @see java.lang.Runtime#exit(int)
* @see java.lang.Runtime#gc()
* @see java.lang.SecurityManager#checkExit(int)
* @since 1.1
*/
@Deprecated(since="1.2", forRemoval=true)
@SuppressWarnings("removal")
public static void runFinalizersOnExit(boolean value) {
Runtime.runFinalizersOnExit(value);
}
/**
* Loads the native library specified by the filename argument. The filename
* argument must be an absolute path name.