RFR: 8355301: Simplify Throwable::printStackTrace by replacing inner class with static method [v4]

Alan Bateman alanb at openjdk.org
Wed Apr 23 06:46:41 UTC 2025


On Wed, 23 Apr 2025 01:31:56 GMT, Shaojin Wen <swen at openjdk.org> wrote:

>> The current Throwable::printStackTrace implementation uses three inner classes PrintStreamOrWriter/WrappedPrintStream/WrappedPrintWriter. We can introduce a static method println to replace these three embedded classes.
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   printStackTrace0

src/java.base/share/classes/java/lang/Throwable.java line 689:

> 687:     }
> 688: 
> 689:     private void printStackTrace0(Object printer) {

Ugh, hopefully this will be replaced in the next iteration.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24795#discussion_r2055363102


More information about the core-libs-dev mailing list