From 3ac021da02fec700d5dd8aac44d38fb65f59457f Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 19:54:19 +0100 Subject: [PATCH] [java] Remove support for named record patterns --- pmd-java/etc/grammar/Java.jjt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 475546acce..f1e87b3ce3 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -3,6 +3,7 @@ * SwitchLabel simplified * Support "JEP 432: Record Patterns (Second Preview)" for Java 20 Preview * ForStatement allows record patterns + * Removed named record patterns (optional VariableDeclaratorId following the pattern) * Remove support for Java 18 preview language features * GuardedPattern is removed * Andreas Dangel 02/2023 @@ -1838,7 +1839,7 @@ void TypePattern(): void RecordPattern(): { checkForRecordPatterns(); } { - (Annotation())* ReferenceType() RecordStructurePattern() [ VariableDeclaratorId() ] + (Annotation())* ReferenceType() RecordStructurePattern() } void RecordStructurePattern() #ComponentPatternList: