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

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

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source, binary
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      Methods long deprecated and long throwing exceptions when called.
    • Interface Kind:
      Java API
    • Scope:
      SE

      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)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: