Skip to content

Commit 1750efa

Browse files
committed
fix
1 parent dca7371 commit 1750efa

File tree

5 files changed

+185
-1
lines changed

5 files changed

+185
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/springframework-5.2.3:${testdir}/../../../../stubs/mvel2-2.4.7:${testdir}/../../../../stubs/jsr223-api:${testdir}/../../../../stubs/scriptengine:${testdir}/../../../../stubs/java-ee-el:${testdir}/../../../../stubs/juel-2.2:${testdir}/../../../stubs/groovy-all-3.0.7:${testdir}/../../../../stubs/servlet-api-2.4:${testdir}/../../../../stubs/jython-2.7.2:${testdir}/../../../../experimental/stubs/rhino-1.7.13:${testdir}/../../../../stubs/bsh-2.0b5
1+
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/springframework-5.2.3:${testdir}/../../../../stubs/mvel2-2.4.7:${testdir}/../../../../stubs/jsr223-api:${testdir}/../../../../stubs/scriptengine:${testdir}/../../../../stubs/java-ee-el:${testdir}/../../../../stubs/juel-2.2:${testdir}/../../../stubs/groovy-all-3.0.7:${testdir}/../../../../stubs/servlet-api-2.4:${testdir}/../../../../stubs/jython-2.7.2:${testdir}/../../../../experimental/stubs/rhino-1.7.13:${testdir}/../../../../stubs/bsh-2.0b5:${testdir}/../../../../stubs/jshell
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package jdk.jshell;
2+
3+
import java.util.List;
4+
import java.lang.IllegalStateException;
5+
6+
public class JShell implements AutoCloseable {
7+
8+
JShell(Builder b) throws IllegalStateException { }
9+
10+
public static class Builder {
11+
12+
Builder() { }
13+
14+
public JShell build() throws IllegalStateException {
15+
return null;
16+
}
17+
}
18+
19+
public static JShell create() throws IllegalStateException {
20+
return null;
21+
}
22+
23+
public static Builder builder() {
24+
return null;
25+
}
26+
27+
public SourceCodeAnalysis sourceCodeAnalysis() {
28+
return null;
29+
}
30+
31+
public List<SnippetEvent> eval(String input) throws IllegalStateException {
32+
return null;
33+
}
34+
35+
@Override
36+
public void close() { }
37+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package jdk.jshell;
2+
3+
public abstract class Snippet {
4+
5+
public enum Kind {
6+
7+
IMPORT(true),
8+
9+
TYPE_DECL(true),
10+
11+
METHOD(true),
12+
13+
VAR(true),
14+
15+
EXPRESSION(false),
16+
17+
STATEMENT(false),
18+
19+
ERRONEOUS(false);
20+
21+
private final boolean isPersistent;
22+
23+
Kind(boolean isPersistent) {
24+
this.isPersistent = isPersistent;
25+
}
26+
27+
public boolean isPersistent() {
28+
return false;
29+
}
30+
}
31+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package jdk.jshell;
2+
3+
public class SnippetEvent {
4+
5+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
package jdk.jshell;
2+
3+
import java.util.Collection;
4+
import java.util.List;
5+
6+
public abstract class SourceCodeAnalysis {
7+
8+
public abstract CompletionInfo analyzeCompletion(String input);
9+
10+
public abstract List<Suggestion> completionSuggestions(String input, int cursor, int[] anchor);
11+
12+
public abstract List<Documentation> documentation(String input, int cursor, boolean computeJavadoc);
13+
14+
public abstract String analyzeType(String code, int cursor);
15+
16+
public abstract QualifiedNames listQualifiedNames(String code, int cursor);
17+
18+
public abstract SnippetWrapper wrapper(Snippet snippet);
19+
20+
public abstract List<SnippetWrapper> wrappers(String input);
21+
22+
public abstract Collection<Snippet> dependents(Snippet snippet);
23+
24+
SourceCodeAnalysis() {}
25+
26+
public interface CompletionInfo {
27+
28+
Completeness completeness();
29+
30+
String remaining();
31+
32+
String source();
33+
}
34+
35+
public enum Completeness {
36+
37+
COMPLETE(true),
38+
39+
COMPLETE_WITH_SEMI(true),
40+
41+
DEFINITELY_INCOMPLETE(false),
42+
43+
CONSIDERED_INCOMPLETE(false),
44+
45+
EMPTY(false),
46+
47+
UNKNOWN(true);
48+
49+
private final boolean isComplete;
50+
51+
Completeness(boolean isComplete) {
52+
this.isComplete = isComplete;
53+
}
54+
55+
public boolean isComplete() {
56+
return isComplete;
57+
}
58+
}
59+
60+
public interface Suggestion {
61+
62+
String continuation();
63+
64+
boolean matchesType();
65+
}
66+
67+
public interface Documentation {
68+
69+
String signature();
70+
71+
String javadoc();
72+
}
73+
74+
public static final class QualifiedNames {
75+
76+
77+
QualifiedNames(List<String> names, int simpleNameLength, boolean upToDate, boolean resolvable) { }
78+
79+
public List<String> getNames() {
80+
return null;
81+
}
82+
83+
public int getSimpleNameLength() {
84+
return 1;
85+
}
86+
87+
public boolean isUpToDate() {
88+
return false;
89+
}
90+
91+
public boolean isResolvable() {
92+
return false;
93+
}
94+
95+
}
96+
97+
public interface SnippetWrapper {
98+
99+
String source();
100+
101+
String wrapped();
102+
103+
String fullClassName();
104+
105+
Snippet.Kind kind();
106+
107+
int sourceToWrappedPosition(int pos);
108+
109+
int wrappedToSourcePosition(int pos);
110+
}
111+
}

0 commit comments

Comments
 (0)