diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 7588c36ce9..65f9f91c4f 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1812,8 +1812,7 @@ void PrimaryPrefix() : Literal() | LOOKAHEAD(2) "this" {jjtThis.setUsesThisModifier();} | "super" {jjtThis.setUsesSuperModifier();} -| LOOKAHEAD( "(" ")" "->" ) LambdaExpression() -| LOOKAHEAD( VariableDeclaratorId() "->" ) LambdaExpression() +| LOOKAHEAD( "->" ) LambdaExpression() | LOOKAHEAD( "(" VariableDeclaratorId() ( "," VariableDeclaratorId() )* ")" "->" ) LambdaExpression() | LOOKAHEAD( FormalParameters() "->" ) LambdaExpression() | LOOKAHEAD(3) "(" Expression() ")"