Thread.countStackFrames is an ill-defined method from JDK 1.0 that depended on thread suspension. The history on this method is:

    - Deprecated in JDK 1.2 (1998)
    - Deprecated for removal in Java 9
    - Re-specified/degraded to throw UOE unconditionally in Java 14

    The StackWalker API was added in Java 9 to support stack walking needs. This provides a much better API for anything that might need to count stack frames.

    A corpus analysis of 30M classes in 131k artifacts, found 1 references to this method.

      csr for

      CSR - nullJDK-8309201Remove Thread.countStackFrames

      • P4 - Minor loss of function, or other problem where easy workaround is present.
      • Closed
      links to

      CommitCommitopenjdk/jdk/b2a5271e

        ReviewReviewopenjdk/jdk/14257