Quality Outreach Heads-up - JDK 20: Thread.stop(), Thread.suspend() and Thread.resume() degradation
David Delabassee on November 9, 2022The OpenJDK Quality Group promotes the testing of FOSS projects with OpenJDK Early-Access builds as a way to improve the overall quality of the release. This heads-up is part of a regular communication sent to the projects involved. To learn more about the program, and how-to join, please check here.
JDK 20 - Thread.stop(), Thread.suspend() and Thread.resume() degradation”
The ability to stop, suspend, or resume a thread with the corresponding Thread.stop()
, Thread.suspend()
or Thread.resume()
methods have been removed in JDK 20. Those methods have been degraded to throw a UOE exception (UnsupportedOperationException).
Using those methods was inherently unsafe. That is also why they were deprecated since JDK 1.2 (1998!) and were flagged ‘forRemoval’ in previous features release.
We do not expect this behavior change to cause issues on well-maintained codebase.
More information
For more details please check JDK-8289610, JDK-8249627, and the Java Thread Primitive Deprecation FAQ.