The Throwable class provides access to stack backtrace information via its
printStackTrace methods. Unfortunately, this information is available only in
string form. When programmers want to do anything sophisticated with this
information (such as print out only the top of the stack, or filter out
certain stack frames), they are forced to parse the string. The API
explicitly states that the precise form of the string is implementation-
dependent, but programmers do write non-portable parsing code that depends on
the details of the format. To rectify this situation, we must provide
programmatic access to this backtrace information.
printStackTrace methods. Unfortunately, this information is available only in
string form. When programmers want to do anything sophisticated with this
information (such as print out only the top of the stack, or filter out
certain stack frames), they are forced to parse the string. The API
explicitly states that the precise form of the string is implementation-
dependent, but programmers do write non-portable parsing code that depends on
the details of the format. To rectify this situation, we must provide
programmatic access to this backtrace information.
- duplicates
-
JDK-4271561 Throwable.getStackTrace() would be very convenient
-
- Closed
-
-
JDK-4441423 Enhancement: Provide controlled access to the stack.
-
- Closed
-