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

Remove ThreadGroup.allowThreadSuspension

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P4
    • 21
    • core-libs
    • None
    • source, binary
    • minimal
    • Hide
      The method does nothing and has been deprecated for 24 years so the likelihood of something depending on it is low. It's possible there is code somewhere that "wraps" a ThreadGroup and delegates all methods. This code will no longer compile without change. If compiled to an older release then it will continue to run on new releases, except if wrapper.allowThreadSuspension(b) is called, in which case NoSuchMethodError is thrown.
      Show
      The method does nothing and has been deprecated for 24 years so the likelihood of something depending on it is low. It's possible there is code somewhere that "wraps" a ThreadGroup and delegates all methods. This code will no longer compile without change. If compiled to an older release then it will continue to run on new releases, except if wrapper.allowThreadSuspension(b) is called, in which case NoSuchMethodError is thrown.
    • Java API
    • SE

    Description

      Summary

      Remove method java.lang.ThreadGroup.allowThreadSuspension(boolean).

      Problem

      ThreadGroup.allowThreadSuspension dates from JDK 1.1 and classic VM. It was never specified. Archaeology suggests it controlled whether the GC suspended threads when an allocation failed and the GC was unable to satisfy. It appears to have interacted with a classic VM specific callback mechanism that could potentially free memory, allowing the GC to retry.

      The method was deprecated in JDK 1.2 and seems to have been changed to be a no-op in the same release. It was deprecated for removal in Java 14.

      We haven't found any evidence of usage in the eco system. A corpus analysis of 30378800 classes in 130997 artifacts found 0 usages of this method.

      It is time to finally remove this method.

      Solution

      Remove the method.

      Specification

      Remove java.lang.ThreadGroup.allowThreadSuspension(boolean).

      Attachments

        Issue Links

          Activity

            People

              alanb Alan Bateman
              alanb Alan Bateman
              Chris Hegarty, Stuart Marks
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: