-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b141
-
Verified
Reported by Paul Deitel.
------------
jshell> int x = 1
x ==> 1
jshell> int y = 3
y ==> 3
jshell> if (x < y) {
...> printf("%d is less than %d", x, y);
...> }
1 is less than 3
jshell> /list
1 : int x = 1;
2 : int y = 3;
3 : if (x < y) {
printf("%d is less than %d", x, y);
}
jshell> /drop 3
| This command does not accept the snippet '3' : if (x < y) {
| printf("%d is less than %d", x, y);
| }
| See /types, /methods, /vars, or /list
jshell> /list 3
3 : if (x < y) {
printf("%d is less than %d", x, y);
}
jshell> /drop 1
| dropped variable x
-------------------------
The message should be clearer why it is not accepted.
OR, though it does not effect execution state, drop of a statement (at the API level) could/should just change the status of the Snippet as it does for DeclarationSnippets.
------------
jshell> int x = 1
x ==> 1
jshell> int y = 3
y ==> 3
jshell> if (x < y) {
...> printf("%d is less than %d", x, y);
...> }
1 is less than 3
jshell> /list
1 : int x = 1;
2 : int y = 3;
3 : if (x < y) {
printf("%d is less than %d", x, y);
}
jshell> /drop 3
| This command does not accept the snippet '3' : if (x < y) {
| printf("%d is less than %d", x, y);
| }
| See /types, /methods, /vars, or /list
jshell> /list 3
3 : if (x < y) {
printf("%d is less than %d", x, y);
}
jshell> /drop 1
| dropped variable x
-------------------------
The message should be clearer why it is not accepted.
OR, though it does not effect execution state, drop of a statement (at the API level) could/should just change the status of the Snippet as it does for DeclarationSnippets.