This is an automated email from the ASF dual-hosted git repository. paulk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push: new 61568fc0c0 GROOVY-11347: Support JDK 23 61568fc0c0 is described below commit 61568fc0c03dfba04a92052bee766cb6bc6d4c8a Author: Paul King <pa...@asert.com.au> AuthorDate: Tue Mar 26 22:12:26 2024 +1000 GROOVY-11347: Support JDK 23 --- src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | 5 ++++- src/test/org/codehaus/groovy/control/CompilerConfigurationTest.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java index 15eaeb9fa2..7eedc75250 100644 --- a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java +++ b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java @@ -103,6 +103,8 @@ public class CompilerConfiguration { public static final String JDK21 = "21"; /** This (<code>"22"</code>) is the value for targetBytecode to compile for a JDK 22. */ public static final String JDK22 = "22"; + /** This (<code>"22"</code>) is the value for targetBytecode to compile for a JDK 23. */ + public static final String JDK23 = "23"; /** * JDK version to bytecode version mapping. @@ -119,7 +121,8 @@ public class CompilerConfiguration { JDK19, Opcodes.V19, JDK20, Opcodes.V20, JDK21, Opcodes.V21, - JDK22, Opcodes.V22 + JDK22, Opcodes.V22, + JDK23, Opcodes.V23 ); public static final String DEFAULT_TARGET_BYTECODE = defaultTargetBytecode(); diff --git a/src/test/org/codehaus/groovy/control/CompilerConfigurationTest.java b/src/test/org/codehaus/groovy/control/CompilerConfigurationTest.java index 4d96a4fcee..3a5311aa85 100644 --- a/src/test/org/codehaus/groovy/control/CompilerConfigurationTest.java +++ b/src/test/org/codehaus/groovy/control/CompilerConfigurationTest.java @@ -297,8 +297,8 @@ public final class CompilerConfigurationTest { @Test // GROOVY-10278 public void testTargetVersion() { CompilerConfiguration config = new CompilerConfiguration(); - String[] inputs = {"1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "5" , "6" , "7" , "8" , "9" , "9.0", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"}; - String[] expect = {"11" , "11" , "11" , "11" , "11" , "11" , "11" , "11", "11", "11", "11", "11", "11" , "11", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "22"}; + String[] inputs = {"1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "5" , "6" , "7" , "8" , "9" , "9.0", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"}; + String[] expect = {"11" , "11" , "11" , "11" , "11" , "11" , "11" , "11", "11", "11", "11", "11", "11" , "11", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "23"}; assertArrayEquals(expect, Arrays.stream(inputs).map(v -> { config.setTargetBytecode(v); return config.getTargetBytecode(); }).toArray(String[]::new)); } }