Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b17
Description
Degrade Thread.stop to throw UOE unconditionally and deprecate, for removal, ThreadDeath.
Thread.stop is inherently unsafe and has been deprecated, along with Thread.stop(Throwable) and ThreadGroup.stop() since JDK 1.2. The "progress" on removing this feature to date is as follows:
- Thread.stop(Throwable) was degraded to throw UOE in Java 8
- Thread.stop(Throwable) was deprecated for removal in Java 9 (Enhanced deprecation did not exist in Java 8)
- Thread.stop(Throwable) was removed in Java 11
- ThreadGroup.stop() was deprecated for removal in Java 16
- ThreadGroup.stop() was degraded to throw UOE in Java 19
- The no-arg Thread.stop() was deprecated for removal in Java 18
The next step is to to degrade Thread.stop to throw UOE. This will require updates to JLS 11.1.3 and JVMS 2.10 where asynchronous exceptions are defined.
This change will have no impact on the debugger APIs (JVM TI StopThread, JDWP ThreadReference/Stop, and JDI ThreadReference.stop). The APIs can be used to cause an asynchronous exception as before.
Thread.stop is inherently unsafe and has been deprecated, along with Thread.stop(Throwable) and ThreadGroup.stop() since JDK 1.2. The "progress" on removing this feature to date is as follows:
- Thread.stop(Throwable) was degraded to throw UOE in Java 8
- Thread.stop(Throwable) was deprecated for removal in Java 9 (Enhanced deprecation did not exist in Java 8)
- Thread.stop(Throwable) was removed in Java 11
- ThreadGroup.stop() was deprecated for removal in Java 16
- ThreadGroup.stop() was degraded to throw UOE in Java 19
- The no-arg Thread.stop() was deprecated for removal in Java 18
The next step is to to degrade Thread.stop to throw UOE. This will require updates to JLS 11.1.3 and JVMS 2.10 where asynchronous exceptions are defined.
This change will have no impact on the debugger APIs (JVM TI StopThread, JDWP ThreadReference/Stop, and JDI ThreadReference.stop). The APIs can be used to cause an asynchronous exception as before.
Attachments
Issue Links
- blocks
-
JDK-8293592 Remove JVM_StopThread, stillborn, and related cleanup
- Resolved
- csr for
-
JDK-8293843 Degrade Thread.stop
- Closed
- relates to
-
JDK-8286768 Release Note: java.lang.ThreadGroup Is degraded
- Resolved
-
JDK-8204243 remove Thread.destroy() and Thread.stop(Throwable)
- Resolved
-
JDK-8249627 Degrade Thread.suspend and Thread.resume
- Resolved
-
JDK-8277861 Terminally deprecate Thread.stop
- Resolved
-
JDK-8235801 compiler/c2/Test8004741.java failed due to "Error: test method didn't get compiled"
- Open
(2 relates to, 2 links to)