[java] Fix compile errors after merge

This commit is contained in:
Andreas Dangel
2022-07-10 15:31:29 +02:00
parent ffbe5b7378
commit 183a322d7c
5 changed files with 7 additions and 22 deletions

View File

@ -1743,7 +1743,7 @@ void TypePattern():
}
void RecordPattern():
{ checkForRecordPatterns(); }
{}
{
ReferenceType() RecordStructurePattern() [ VariableDeclaratorId() ]
}
@ -2476,7 +2476,6 @@ void CaseLabelElement(ASTSwitchLabel label) #void:
void Guard() #SwitchGuard:
{
Token t;
checkForGuard();
}
{
t = <IDENTIFIER> {

View File

@ -19,17 +19,13 @@ import net.sourceforge.pmd.annotation.Experimental;
* @see <a href="https://openjdk.org/jeps/405">JEP 405: Record Patterns (Preview)</a>
*/
@Experimental
public final class ASTComponentPatternList extends AbstractJavaNode {
public final class ASTComponentPatternList extends ASTList<ASTPattern> {
ASTComponentPatternList(int id) {
super(id);
}
ASTComponentPatternList(JavaParser p, int id) {
super(p, id);
super(id, ASTPattern.class);
}
@Override
public Object jjtAccept(JavaParserVisitor visitor, Object data) {
protected <P, R> R acceptVisitor(JavaVisitor<? super P, ? extends R> visitor, P data) {
return visitor.visit(this, data);
}
}

View File

@ -26,13 +26,8 @@ public final class ASTRecordPattern extends AbstractJavaNode implements ASTPatte
super(id);
}
ASTRecordPattern(JavaParser p, int id) {
super(p, id);
}
@Override
public Object jjtAccept(JavaParserVisitor visitor, Object data) {
protected <P, R> R acceptVisitor(JavaVisitor<? super P, ? extends R> visitor, P data) {
return visitor.visit(this, data);
}

View File

@ -25,13 +25,8 @@ public final class ASTSwitchGuard extends AbstractJavaNode {
super(id);
}
ASTSwitchGuard(JavaParser p, int id) {
super(p, id);
}
@Override
public Object jjtAccept(JavaParserVisitor visitor, Object data) {
protected <P, R> R acceptVisitor(JavaVisitor<? super P, ? extends R> visitor, P data) {
return visitor.visit(this, data);
}

View File

@ -18,7 +18,7 @@ import net.sourceforge.pmd.lang.java.JavaParsingHelper;
public class Java19PreviewTreeDumpTest extends BaseTreeDumpTest {
private final JavaParsingHelper java19p =
JavaParsingHelper.WITH_PROCESSING.withDefaultVersion("19-preview")
JavaParsingHelper.DEFAULT.withDefaultVersion("19-preview")
.withResourceContext(Java19PreviewTreeDumpTest.class, "jdkversiontests/java19p/");
private final JavaParsingHelper java19 = java19p.withDefaultVersion("19");