8277861: Terminally deprecate Thread.stop

Reviewed-by: rriggs, mchung, uschindler, dholmes
This commit is contained in:
Alan Bateman 2021-12-01 08:44:51 +00:00
parent 70d5dffb4e
commit fde0b95ede
2 changed files with 2 additions and 1 deletions

View file

@ -922,7 +922,7 @@ public class Thread implements Runnable {
* <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">Why * <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
* are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>. * are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
*/ */
@Deprecated(since="1.2") @Deprecated(since="1.2", forRemoval=true)
public final void stop() { public final void stop() {
@SuppressWarnings("removal") @SuppressWarnings("removal")
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();

View file

@ -628,6 +628,7 @@ public class ThreadGroup implements Thread.UncaughtExceptionHandler {
* {@link Thread#stop} for details. * {@link Thread#stop} for details.
*/ */
@Deprecated(since="1.2", forRemoval=true) @Deprecated(since="1.2", forRemoval=true)
@SuppressWarnings("removal")
public final void stop() { public final void stop() {
if (stopOrSuspend(false)) if (stopOrSuspend(false))
Thread.currentThread().stop(); Thread.currentThread().stop();