This is an automated email from the ASF dual-hosted git repository. paulk-asert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 69d49bac68b5b67b1bc98d5117cffb9b547a6ff7 Author: Paul King <[email protected]> AuthorDate: Fri May 22 14:12:22 2026 +1000 GROOVY-12028: Add JDK27 constants --- src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | 5 ++++- .../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 8a8aaaddb1..2f1ec07db3 100644 --- a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java +++ b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java @@ -112,6 +112,8 @@ public class CompilerConfiguration { public static final String JDK25 = "25"; /** This (<code>"26"</code>) is the value for targetBytecode to compile for a JDK 26. */ public static final String JDK26 = "26"; + /** This (<code>"27"</code>) is the value for targetBytecode to compile for a JDK 27. */ + public static final String JDK27 = "27"; /** * JDK version to bytecode version mapping. @@ -132,7 +134,8 @@ public class CompilerConfiguration { JDK23, Opcodes.V23, JDK24, Opcodes.V24, JDK25, Opcodes.V25, - JDK26, Opcodes.V26 + JDK26, Opcodes.V26, + JDK27, Opcodes.V27 ); public static final String DEFAULT_TARGET_BYTECODE = defaultTargetBytecode(); diff --git a/src/test/groovy/org/codehaus/groovy/control/CompilerConfigurationTest.java b/src/test/groovy/org/codehaus/groovy/control/CompilerConfigurationTest.java index 44d93e17df..ae5ca37331 100644 --- a/src/test/groovy/org/codehaus/groovy/control/CompilerConfigurationTest.java +++ b/src/test/groovy/org/codehaus/groovy/control/CompilerConfigurationTest.java @@ -286,8 +286,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", "25", "26", "27"}; - 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", "25", "26", "26"}; + 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", "26", "27", "28"}; + 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", "25", "26", "27", "27"}; assertArrayEquals(expect, Arrays.stream(inputs).map(v -> { config.setTargetBytecode(v); return config.getTargetBytecode(); }).toArray(String[]::new)); } }
