JDK-8204260 : remove Thread.destroy() and Thread.stop(Throwable)
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 11
  • Submitted: 2018-06-02
  • Updated: 2018-06-08
  • Resolved: 2018-06-08
Related Reports
CSR :  
Description
Summary
-------

The Thread.destroy() and Thread.stop(Throwable) APIs will be removed from Java SE.

Problem
-------

Thread.destroy() has never been implemented, and has always done nothing more than throwing NoSuchMethodError to the caller. Thread.stop(Throwable) is exceedingly dangerous, and it has been "degraded" since JDK 8 to do nothing more than to throw UnsupportedOperationException to the caller. They have both been deprecated for removal since Java 9.

Solution
--------

Remove the APIs from the Thread class. Make minor adjustments to the specifications for JDI, JDWP, and JVMTI to remove or avoid references to the Thread.stop(Throwable) method.

Specification
-------------

The attached diff contains details of the specification changes. Some changes have Java SE scope whereas some have JDK scope.

Java SE:

* java.lang.Thread.destroy() - removed
* java.lang.Thread.stop(Throwable) - removed
* java/lang/doc-files/threadPrimitiveDeprecation.html - remove sections that mention the above methods

JDK:

* jdwp.spec - changes to the JDWP wire protocol spec, to remove reference to Thread.stop()
* jvmti.xml - adjustment to the JVMTI specification to refer to the no-arg Thread.stop() method that is not being removed
* com.sun.jdk.ThreadReference.stop() - remove cross-reference to java.lang.Thread.stop(Throwable)

Comments
Moving to Approved.
08-06-2018