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

markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 5dff0685f5 Fix Gump failures
5dff0685f5 is described below

commit 5dff0685f54c9b05227f6854651264d991377b8c
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Nov 27 10:06:38 2026 +0000

    Fix Gump failures
    
    Adds a Java 25 check to JreCompat
---
 .../org/apache/tomcat/util/compat/Jre25Compat.java | 40 ++++++++++++++++++++++
 java/org/apache/tomcat/util/compat/JreCompat.java  | 31 ++++++++++++++++-
 .../tribes/group/TestGroupChannelTlsFFM.java       |  2 +-
 3 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre25Compat.java 
b/java/org/apache/tomcat/util/compat/Jre25Compat.java
new file mode 100644
index 0000000000..32a5cf196d
--- /dev/null
+++ b/java/org/apache/tomcat/util/compat/Jre25Compat.java
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tomcat.util.compat;
+
+/**
+ * JRE 25 compatibility implementation.
+ */
+public class Jre25Compat extends Jre22Compat {
+
+    /**
+     * Constructs a new Jre25Compat.
+     */
+    public Jre25Compat() {
+    }
+
+    private static final boolean supported;
+
+
+    static {
+        supported = Runtime.version().feature() > 24;
+    }
+
+    static boolean isSupported() {
+        return supported;
+    }
+}
diff --git a/java/org/apache/tomcat/util/compat/JreCompat.java 
b/java/org/apache/tomcat/util/compat/JreCompat.java
index 4ab1356c55..a0e6b11918 100644
--- a/java/org/apache/tomcat/util/compat/JreCompat.java
+++ b/java/org/apache/tomcat/util/compat/JreCompat.java
@@ -58,6 +58,7 @@ public class JreCompat {
     private static final boolean jre20Available;
     private static final boolean jre21Available;
     private static final boolean jre22Available;
+    private static final boolean jre25Available;
 
     protected static final String USE_CANON_CACHES_CMD_ARG = 
"-Dsun.io.useCanonCaches=";
     protected static volatile Boolean canonCachesDisabled;
@@ -79,8 +80,19 @@ public class JreCompat {
 
         // This is Tomcat 10.1.x with a minimum Java version of Java 11.
         // Look for the highest supported JVM first
-        if (Jre22Compat.isSupported()) {
+        if (Jre25Compat.isSupported()) {
+            instance = new Jre25Compat();
+            jre25Available = true;
+            jre22Available = true;
+            jre21Available = true;
+            jre20Available = true;
+            jre19Available = true;
+            jre17Available = true;
+            jre16Available = true;
+            jre12Available = true;
+        } else if (Jre22Compat.isSupported()) {
             instance = new Jre22Compat();
+            jre25Available = false;
             jre22Available = true;
             jre21Available = true;
             jre20Available = true;
@@ -90,6 +102,7 @@ public class JreCompat {
             jre12Available = true;
         } else if (Jre21Compat.isSupported()) {
             instance = new Jre21Compat();
+            jre25Available = false;
             jre22Available = false;
             jre21Available = true;
             jre20Available = true;
@@ -99,6 +112,7 @@ public class JreCompat {
             jre12Available = true;
         } else if (Jre20Compat.isSupported()) {
             instance = new Jre20Compat();
+            jre25Available = false;
             jre22Available = false;
             jre21Available = false;
             jre20Available = true;
@@ -108,6 +122,7 @@ public class JreCompat {
             jre12Available = true;
         } else if (Jre19Compat.isSupported()) {
             instance = new Jre19Compat();
+            jre25Available = false;
             jre22Available = false;
             jre21Available = false;
             jre20Available = false;
@@ -117,6 +132,7 @@ public class JreCompat {
             jre12Available = true;
         } else if (Jre17Compat.isSupported()) {
             instance = new Jre17Compat();
+            jre25Available = false;
             jre22Available = false;
             jre21Available = false;
             jre20Available = false;
@@ -126,6 +142,7 @@ public class JreCompat {
             jre12Available = true;
         } else if (Jre16Compat.isSupported()) {
             instance = new Jre16Compat();
+            jre25Available = false;
             jre22Available = false;
             jre21Available = false;
             jre20Available = false;
@@ -135,6 +152,7 @@ public class JreCompat {
             jre12Available = true;
         } else if (Jre12Compat.isSupported()) {
             instance = new Jre12Compat();
+            jre25Available = false;
             jre22Available = false;
             jre21Available = false;
             jre20Available = false;
@@ -144,6 +162,7 @@ public class JreCompat {
             jre12Available = true;
         } else {
             instance = new JreCompat();
+            jre25Available = false;
             jre22Available = false;
             jre21Available = false;
             jre20Available = false;
@@ -215,6 +234,16 @@ public class JreCompat {
     }
 
 
+    /**
+     * Check if JRE 25 is available.
+     *
+     * @return {@code true} if JRE 25 is available
+     */
+    public static boolean isJre25Available() {
+        return jre25Available;
+    }
+
+
     // Java 11 implementations of Java 16 methods
 
     /**
diff --git a/test/org/apache/catalina/tribes/group/TestGroupChannelTlsFFM.java 
b/test/org/apache/catalina/tribes/group/TestGroupChannelTlsFFM.java
index df6c1036e3..6a386fe6f0 100644
--- a/test/org/apache/catalina/tribes/group/TestGroupChannelTlsFFM.java
+++ b/test/org/apache/catalina/tribes/group/TestGroupChannelTlsFFM.java
@@ -31,7 +31,7 @@ public class TestGroupChannelTlsFFM extends 
GroupChannelTlsTestBase {
 
     @Before
     public void setup() throws Exception {
-        Assume.assumeTrue("FFM requires Java 22+", 
JreCompat.isJre22Available());
+        Assume.assumeTrue("FFM support is compiled with Java 25+", 
JreCompat.isJre25Available());
         try {
             openSSLLibraryInit();
         } catch (Throwable t) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to