RFR 8167128: jshell tool: /drop of statement gives confusing output

Robert Field robert.field at oracle.com
Fri Oct 7 17:19:40 UTC 2016


Using /drop on anything other than a declaration in the jshell tool 
gives an error (and a confusing one at that).
For example, dropping a statement or variable value query causes an error.
The underlying cause is that drop() in the API only has semantic impact 
when declarations are changed and so was restricted to declarations.
If does however also change the status and the tool uses the status, for 
example to determine which snippets are saved or, by default, listed.
There is no advantage to this restriction and it reduces symmetry. This 
change allows drop (at all levels) for all kinds of snippets.

Bug:
     https://bugs.openjdk.java.net/browse/JDK-8167128

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

API:
     http://cr.openjdk.java.net/~rfield/8167128v0.API/

The API changes are minor and include:
http://cr.openjdk.java.net/~rfield/8167128v0.API/jdk/jshell/JShell.html#drop-jdk.jshell.Snippet-
http://cr.openjdk.java.net/~rfield/8167128v0.API/jdk/jshell/PersistentSnippet.html
http://cr.openjdk.java.net/~rfield/8167128v0.API/jdk/jshell/Snippet.Status.html

Thanks,
Robert



More information about the kulla-dev mailing list