Relates :
|
|
Relates :
|
If I evaluate an expression which results in throwing an exception, and that exception has a cause, the cause is not included in the stack trace: jshell> $8.resolveConstantRef(MethodHandles.lookup()) | java.lang.BootstrapMethodError thrown: bootstrap method initialization exception | at BootstrapMethodInvoker.invoke (BootstrapMethodInvoker.java:174) | at ConstantBootstraps.makeConstant (ConstantBootstraps.java:66) | at DynamicConstantRef.resolveConstantRef (DynamicConstantRef.java:308) | at (#22:1) This exception had a chained cause, but it wasn't displayed. (Its pretty hard to debug the above without the underlying cause.) ----------- The cause is not propagated at initial interception in the execution engine. This requires changes in the user code execution, the execution SPI, the representation of exceptions on the stream, the handling of evaluation, the JShell API, and the jshell tool. ----------- The existing jshell tool display format for exceptions was not designed with chained exceptions in mind. It is not superior to that used by printStackTrace() and the JVM. Consistency with these is useful for transitioning. So, the jshell tool will use the standard format (which handles chained exceptions).