diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index c742d34f1a..43eaed8593 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -481,7 +481,7 @@ public class JavaParser { } private void checkForNewStringSpaceEscape(String s) { - if (!(jdkVersion >= 15) && s.contains("\\s") && !s.contains("\\\\s")) { + if (jdkVersion < 15 && s.contains("\\s") && !s.contains("\\\\s")) { throwParseException("The escape sequence \"\\s\" is only supported with Java >= 15"); } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPermitsList.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPermitsList.java index 4d0f281333..baa03e532b 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPermitsList.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPermitsList.java @@ -18,7 +18,7 @@ import net.sourceforge.pmd.annotation.Experimental; * *
* - * PermittedSubclasses ::= "permits" ClassOrInterfaceType + * PermitsList ::= "permits" ClassOrInterfaceType * ( "," ClassOrInterfaceType )* **/