From 35acf34a85e9f35037328fb7ddb2759c229060ee Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Sat, 13 May 2023 22:01:43 +0100 Subject: [PATCH] Support 21-ea as value for java.version in JavaParser (#3242) For https://github.com/openrewrite/rewrite/issues/3170 --- rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java index 703bf017bbb..df27a6f4d01 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java @@ -206,7 +206,7 @@ static List dependenciesFromResources(ExecutionContext ctx, String... arti */ static JavaParser.Builder fromJavaVersion() { JavaParser.Builder javaParser; - String[] versionParts = System.getProperty("java.version").split("\\."); + String[] versionParts = System.getProperty("java.version").split("[.-]"); int version = Integer.parseInt(versionParts[0]); if (version == 1) { version = 8;