This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch danielsun/java24
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/danielsun/java24 by this push:
     new 19d962b775 GROOVY-11497: add JDK24 constant
19d962b775 is described below

commit 19d962b7753da0ae1d99ed1be9b4299f6678ba94
Author: Daniel Sun <[email protected]>
AuthorDate: Sun Oct 20 13:12:14 2024 +0800

    GROOVY-11497: add JDK24 constant
---
 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 54e5d3ca46..688157aa8e 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -105,6 +105,8 @@ public class CompilerConfiguration {
     public static final String JDK22 = "22";
     /** This (<code>"23"</code>) is the value for targetBytecode to compile 
for a JDK 23. */
     public static final String JDK23 = "23";
+    /** This (<code>"23"</code>) is the value for targetBytecode to compile 
for a JDK 23. */
+    public static final String JDK24 = "24";
 
     /**
      * JDK version to bytecode version mapping.
@@ -122,7 +124,8 @@ public class CompilerConfiguration {
             JDK20, Opcodes.V20,
             JDK21, Opcodes.V21,
             JDK22, Opcodes.V22,
-            JDK23, Opcodes.V23
+            JDK23, Opcodes.V23,
+            JDK24, Opcodes.V24
     );
 
     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 3a5311aa85..2d0b4d6437 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", "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"};
+        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", "25"};
+        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", "24", "24"};
         assertArrayEquals(expect, Arrays.stream(inputs).map(v -> { 
config.setTargetBytecode(v); return config.getTargetBytecode(); 
}).toArray(String[]::new));
     }
 }

Reply via email to