Print suppressed exceptions in JShell
Chen Liang
chen.l.liang at oracle.com
Thu Oct 30 23:35:26 UTC 2025
I think it is probably just an oversight. This seems to be printed by JShellTool::displayEvalException, which shouldn't be too hard to add printing for suppressed exceptions.
-Chen
Confidential – Oracle Internal
________________________________
From: compiler-dev <compiler-dev-retn at openjdk.org> on behalf of Pavel Rappo <pavel.rappo at gmail.com>
Sent: Thursday, October 30, 2025 5:06 PM
To: compiler-dev at openjdk.org <compiler-dev at openjdk.org>
Subject: Print suppressed exceptions in JShell
Is there any reason why JShell does not print out suppressed
exceptions? I think it would be good to print them.
jshell> new Throwable()
$1 ==> java.lang.Throwable
jshell> new Error()
$2 ==> java.lang.Error
jshell> $1.addSuppressed($2)
jshell> throw $1
| Exception java.lang.Throwable
| at (#1:1)
-Pavel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20251030/04784185/attachment.htm>
More information about the compiler-dev
mailing list