Skip to content
Permalink
Browse files
8259863: doc: JShell snippet doesn't compile
Reviewed-by: sundar
  • Loading branch information
Jan Lahoda committed Mar 17, 2021
1 parent f9f2eef commit 41276eb83a640a818b39374ac009eb595645b5fc
Showing 1 changed file with 7 additions and 7 deletions.
@@ -68,7 +68,7 @@
* fixed strings, but would come from the user. Below is a very simplified
* example of how the API might be used to implement a REPL.
* <pre>
* {@code
* {@code
* import java.io.ByteArrayInputStream;
* import java.io.Console;
* import java.util.List;
@@ -88,9 +88,9 @@
* List<SnippetEvent> events = js.eval(input);
* for (SnippetEvent e : events) {
* StringBuilder sb = new StringBuilder();
* if (e.causeSnippet == null) {
* if (e.causeSnippet() == null) {
* // We have a snippet creation event
* switch (e.status) {
* switch (e.status()) {
* case VALID:
* sb.append("Successful ");
* break;
@@ -104,16 +104,16 @@
* sb.append("Failed ");
* break;
* }
* if (e.previousStatus == Status.NONEXISTENT) {
* if (e.previousStatus() == Status.NONEXISTENT) {
* sb.append("addition");
* } else {
* sb.append("modification");
* }
* sb.append(" of ");
* sb.append(e.snippet.source());
* sb.append(e.snippet().source());
* System.out.println(sb);
* if (e.value != null) {
* System.out.printf("Value is: %s\n", e.value);
* if (e.value() != null) {
* System.out.printf("Value is: %s\n", e.value());
* }
* System.out.flush();
* }

0 comments on commit 41276eb

Please sign in to comment.