From e1a4b8ae97e5e2fc0e530bd32297b16b1a1ae8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 28 Mar 2020 11:42:16 +0100 Subject: [PATCH] Forbid type params for record ctors --- pmd-java/etc/grammar/Java.jjt | 3 +-- .../pmd/lang/java/ast/ASTRecordConstructorDeclaration.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 80186c015e..2bbda165a6 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1160,7 +1160,7 @@ void RecordBodyDeclaration() #void : private void RecordCtorLookahead() #void: {} { - Modifiers() [ TypeParameters() ] ("throws" | "{") + Modifiers() "{" } void RecordConstructorDeclaration(): @@ -1169,7 +1169,6 @@ void RecordConstructorDeclaration(): } { modifiers = Modifiers() { jjtThis.setModifiers(modifiers); } - [TypeParameters()] { jjtThis.setImage(token.image); } Block() } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordConstructorDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordConstructorDeclaration.java index f262de9ea9..753f40239d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordConstructorDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordConstructorDeclaration.java @@ -14,7 +14,6 @@ import net.sourceforge.pmd.annotation.Experimental; * * RecordConstructorDeclaration ::= ({@linkplain ASTAnnotation Annotation})* * RecordModifiers - * {@linkplain ASTTypeParameters TypeParameters}? * <IDENTIFIER> * {@link ASTBlock Block} *