Adjust message parsing to account for JDK-8230338 88/100388/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Apr 2022 20:48:14 +0000 (22:48 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Apr 2022 21:25:52 +0000 (23:25 +0200)
JDK14 changed the error reporting string, which makes our algorithm
fail. Make sure we account for it.

JIRA: YANGTOOLS-1418
Change-Id: Iea9866c6f98508851f0d558d7e2422740e91ef87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/pattern/RegexUtils.java

index 2da907a189373ad7a87da4bbc566cd6170356de5..8a2a8fb65c35e6b9b0b76d433712de2df02b501c 100644 (file)
@@ -324,6 +324,9 @@ final class RegexUtils {
             if (capturedGroup.startsWith("In/Is")) {
                 // Java 9 changed the reporting string
                 capturedGroup = capturedGroup.substring(5);
+            } else if (capturedGroup.startsWith("Is")) {
+                // Java 14 changed the reporting string (https://bugs.openjdk.java.net/browse/JDK-8230338)
+                capturedGroup = capturedGroup.substring(2);
             }
 
             if (JAVA_UNICODE_BLOCKS.contains(capturedGroup)) {