RFR: 8299934: LocalExecutionControl replaces default uncaught exception handler

Chen Liang liach at openjdk.org
Wed Mar 5 18:04:10 UTC 2025


On Fri, 10 Mar 2023 19:48:42 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> The JShell's `LocalExecutionControl` set the global default uncaught exception handler, causing problems to external code that might rely on it (even if only for logging/debugging purposes).
> 
> The proposal here is to do what the bug is suggesting, and only handling the exception inside the `ThreadGroup` that JShell creates. The patch does not strive to do further changes to how the exception handling is done.

test/langtools/jdk/jshell/LocalExecutionControlExceptionTest.java line 138:

> 136:             //run in a ThreadGroup which does not handle the uncaught exceptions, and let them
> 137:             //pass to the default uncaught handler for the test:
> 138:             var thread = new Thread(Thread.currentThread().getThreadGroup().getParent(), "test-group") {

Is there a reason we cannot use this for `outsideOfJShell` above so we don't need this aop thing?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12982#discussion_r1981909541


More information about the kulla-dev mailing list