From 9a80f1316427f16e4a61d3ae8831fc07f2aec2df Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 27 Feb 2020 21:23:33 +0100 Subject: [PATCH] [java] Fix new escape sequence "\s" detection --- pmd-java/etc/grammar/Java.jjt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index fa6df16f37..5050ae1e88 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -459,7 +459,7 @@ public class JavaParser { } private void checkForNewStringSpaceEscape(String s) { - if ((jdkVersion != 14 || !preview) && s.contains("\\s")) { + if ((jdkVersion != 14 || !preview) && s.contains("\\s") && !s.contains("\\\\s")) { throwParseException("The escape sequence \"\\s\" is only supported with Java 14 Preview"); } }