RFR 8185108: JShell: NullPointerException when throwing exception with null message under local ExecutionControl

Robert Field robert.field at oracle.com
Sat Aug 19 00:00:47 UTC 2017


Please review fixes to handling of SnippetEvent.exception().getMessage()

Bug:

     https://bugs.openjdk.java.net/browse/JDK-8185108

Webrev:

     http://cr.openjdk.java.net/~rfield/8185108v0.webrev/

Issues addressed --

(1) Original issue: using API and DirectExecutionControl (which was not 
intended for direct use), user exceptions with no message (null message) 
crashes eval()

(2) Like (1) above with LocalExecutionControlProvider (which is intended 
for direct use)

(3) Because of (2), "jshell --execution local" crashes with the input 
"throw new java.io.IOException();"

(4) Under default ExecutionControl, exceptions with null messages 
actually return an empty string message in the API.

(5) Because of (4), the default configuration of the jshell tool 
displays a colon that it shouldn't for "throw new java.io.IOException();"

(6) Handling of the streaming representation of a null message was being 
handled in the jdk.jshell package (Eval.java) whereas it should be 
handled in the streaming ExecutionControl support.

(7) The poorly placed implementation of (6) was out-of-sync with the 
behavior of the streaming ExecutionControl support, being the immediate 
cause of (4)




More information about the kulla-dev mailing list