Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 21d422e

Browse files
committed
[native] Set compliance explicitely as a compiler option.
1 parent 2771359 commit 21d422e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

native/src/main/java/bblfsh/EclipseParser.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
package bblfsh;
22

3+
import org.eclipse.jdt.core.JavaCore;
34
import org.eclipse.jdt.core.dom.AST;
45
import org.eclipse.jdt.core.dom.ASTParser;
56
import org.eclipse.jdt.core.dom.CompilationUnit;
67

78
import java.io.IOException;
89

10+
import java.util.Map;
11+
912
/**
1013
* Java AST parser based on Eclipse JDT.
1114
* <p>
@@ -33,6 +36,9 @@ public EclipseParser() {
3336
*/
3437
public CompilationUnit parse(final String source) throws IOException {
3538
parser.setSource(source.toCharArray());
39+
Map options = JavaCore.getOptions();
40+
JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options);
41+
parser.setCompilerOptions(options);
3642
return (CompilationUnit) parser.createAST(null);
3743
}
3844
}

0 commit comments

Comments
 (0)