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

Degrade Thread.stop

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 20
    • None
    • core-libs
    • 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.

      Attachments

        Issue Links

          Activity

            People

              alanb Alan Bateman
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: