Summary
Remove method java.lang.Thread.countStackFrames()
.
Problem
Thread.countStackFrames
is an ill-defined method that dates from JDK 1.0 for counting the stack frames of a suspended Thread (it did not support the operation on the current thread). The method has been deprecated since JDK 1.2 (1998). More recently, the method was deprecated for removal in Java 9, and re-specified/degraded in Java 14 to throw UnsupportedOperationException
unconditionally.
java.lang.StackWalker
was added in Java 9 support stack walking needs. This provides a much better API for anything that might need to count the current thread's stack frames.
A corpus analysis of 30M classes in 131k artifacts found only 1 usages to this method. The 1 usage appears to be a class that just wraps all methods, it doesn't actually make use of it.
It is time to finally remove this method.
Solution
Remove the method.
Specification
Remove method java.lang.Thread.countStackFrames()
.
- csr of
-
JDK-8309196 Remove Thread.countStackFrames
-
- Resolved
-