Open testforstephen opened 1 month ago
I believe there's a discrepancy between our implementation and the upstream JDT core regarding how the AST level is set for the DOM parser.
In the upstream JDT core, when using the DOM ASTParser, the AST level is always set to IASTSharedValues.SHARED_AST_LEVEL, which corresponds to the latest Java version supported by JDT. This can be observed in typical usages of the DOM parser, such as in org.eclipse.jdt.core.manipulation.CoreASTProvider. However, in our implementation with javac, the AST level is determined based on the project's options (see org.eclipse.jdt.internal.core.CompilationUnit.getOrBuildAST). As a result, this approach causes issues when working with Java 17 projects, where the DOM parser does not function correctly.
This issue can easily be reproduced when using Javac bits to work with Java 17 instanceof
syntax.
This commit may fix this issue. We'll see.
@robstryker was that commit ever merged? This issue is still present with the latest builds
I'm trying to use javac bits to open eclipse.jdt.ls project itself, and it throws some error
unconditional patterns in instanceof are not supported in -source 17
.Call stack: