Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8204260

remove Thread.destroy() and Thread.stop(Throwable)

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 11
    • core-libs
    • None
    • source, binary
    • low
    • Methods long deprecated and long throwing exceptions when called.
    • Java API
    • SE

      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)

            smarks Stuart Marks
            smarks Stuart Marks
            Alan Bateman, Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: