JDK-8293852 : Release Note: Thread.Stop changed to throw UnsupportedOperationException
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2022-09-15
  • Updated: 2022-10-15
  • Resolved: 2022-09-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20Resolved
Description
The ability to "stop" a Thread with the `Thread.stop()` method has been removed in this release. The method has been changed to throw `UnsupportedOperationException`. Stopping a Thread by causing it to throw `java.lang.ThreadDeath` was inherently unsafe. The `stop` method has been deprecated since JDK 1.2 (1998). The corresponding method in `ThreadGroup`, to "stop" a group of threads, was changed to throw `UnsupportedOperationException` in Java 19.

As part of this change, `java.lang.ThreadDeath` has been deprecated, for removal.