update parser code to accept java 11 langauge level code
This commit is contained in:
@@ -165,7 +165,7 @@ public final class CompilationUnitCache implements DocumentContentProvider {
|
||||
}
|
||||
|
||||
public static CompilationUnit parse(char[] source, String docURI, String unitName, String[] classpathEntries) throws Exception {
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS10);
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS11);
|
||||
Map<String, String> options = JavaCore.getOptions();
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_10, options);
|
||||
parser.setCompilerOptions(options);
|
||||
|
||||
@@ -322,7 +322,7 @@ public class SpringIndexer {
|
||||
|
||||
private void scanProject(IJavaProject project, String[] files) {
|
||||
try {
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS10);
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS11);
|
||||
String[] classpathEntries = getClasspathEntries(project);
|
||||
|
||||
scanFiles(project, parser, files, classpathEntries);
|
||||
@@ -333,7 +333,7 @@ public class SpringIndexer {
|
||||
}
|
||||
|
||||
private void scanFile(IJavaProject project, String docURI, String content, String[] classpathEntries) throws Exception {
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS10);
|
||||
ASTParser parser = ASTParser.newParser(AST.JLS11);
|
||||
Map<String, String> options = JavaCore.getOptions();
|
||||
JavaCore.setComplianceOptions(JavaCore.VERSION_10, options);
|
||||
parser.setCompilerOptions(options);
|
||||
|
||||
Reference in New Issue
Block a user