Skip to content

Commit 41276eb

Browse files
committed
8259863: doc: JShell snippet doesn't compile
Reviewed-by: sundar
1 parent f9f2eef commit 41276eb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/jdk.jshell/share/classes/jdk/jshell/package-info.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
* fixed strings, but would come from the user. Below is a very simplified
6969
* example of how the API might be used to implement a REPL.
7070
* <pre>
71-
* {@code
71+
* {@code
7272
* import java.io.ByteArrayInputStream;
7373
* import java.io.Console;
7474
* import java.util.List;
@@ -88,9 +88,9 @@
8888
* List<SnippetEvent> events = js.eval(input);
8989
* for (SnippetEvent e : events) {
9090
* StringBuilder sb = new StringBuilder();
91-
* if (e.causeSnippet == null) {
91+
* if (e.causeSnippet() == null) {
9292
* // We have a snippet creation event
93-
* switch (e.status) {
93+
* switch (e.status()) {
9494
* case VALID:
9595
* sb.append("Successful ");
9696
* break;
@@ -104,16 +104,16 @@
104104
* sb.append("Failed ");
105105
* break;
106106
* }
107-
* if (e.previousStatus == Status.NONEXISTENT) {
107+
* if (e.previousStatus() == Status.NONEXISTENT) {
108108
* sb.append("addition");
109109
* } else {
110110
* sb.append("modification");
111111
* }
112112
* sb.append(" of ");
113-
* sb.append(e.snippet.source());
113+
* sb.append(e.snippet().source());
114114
* System.out.println(sb);
115-
* if (e.value != null) {
116-
* System.out.printf("Value is: %s\n", e.value);
115+
* if (e.value() != null) {
116+
* System.out.printf("Value is: %s\n", e.value());
117117
* }
118118
* System.out.flush();
119119
* }

0 commit comments

Comments
 (0)