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

rmaucher pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 7d9b1388d12e6cd53d087da32a426c500d0fa1d8
Author: remm <[email protected]>
AuthorDate: Thu Oct 15 21:44:45 2026 +0200

    Java compatibility
---
 .../modules/MbeansDescriptorsDigesterSource.java   |  3 ++-
 .../modeler/TestBaseModelMBeanNotifications.java   | 24 ++++++++++++++++------
 .../tomcat/util/net/TestLargeClientHello.java      |  1 -
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
index 4799dbc6cb..e0d1c96525 100644
--- 
a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
+++ 
b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
@@ -154,7 +154,7 @@ public class MbeansDescriptorsDigesterSource extends 
ModelerSource {
             }
 
             // Process the input file to configure our registry
-            try (stream) {
+            try {
                 // Push our registry object onto the stack
                 digester.push(loadedMbeans);
                 digester.parse(stream);
@@ -163,6 +163,7 @@ public class MbeansDescriptorsDigesterSource extends 
ModelerSource {
                 throw e;
             } finally {
                 digester.reset();
+                stream.close();
             }
 
         }
diff --git 
a/test/org/apache/tomcat/util/modeler/TestBaseModelMBeanNotifications.java 
b/test/org/apache/tomcat/util/modeler/TestBaseModelMBeanNotifications.java
index 031078b713..4ece92ef04 100644
--- a/test/org/apache/tomcat/util/modeler/TestBaseModelMBeanNotifications.java
+++ b/test/org/apache/tomcat/util/modeler/TestBaseModelMBeanNotifications.java
@@ -80,7 +80,9 @@ public class TestBaseModelMBeanNotifications {
         mbean.removeAttributeChangeNotificationListener(listener, "A");
         send(mbean, "A");
         send(mbean, "B");
-        Assert.assertEquals(List.of("B:hb"), listener.received);
+        List<String> list = new ArrayList<>();
+        list.add("B:hb");
+        Assert.assertEquals(list, listener.received);
     }
 
     @Test
@@ -105,7 +107,9 @@ public class TestBaseModelMBeanNotifications {
         mbean.removeAttributeChangeNotificationListener(listener, "A");
         send(mbean, "A");
         send(mbean, "B");
-        Assert.assertEquals(List.of("B:hb2"), listener.received);
+        List<String> list = new ArrayList<>();
+        list.add("B:hb2");
+        Assert.assertEquals(list, listener.received);
     }
 
     @Test
@@ -117,7 +121,9 @@ public class TestBaseModelMBeanNotifications {
         // A specific name can not be removed from an accept-all registration
         mbean.removeAttributeChangeNotificationListener(listener, "A");
         send(mbean, "A");
-        Assert.assertEquals(List.of("A:hb"), listener.received);
+        List<String> list = new ArrayList<>();
+        list.add("A:hb");
+        Assert.assertEquals(list, listener.received);
         // The accept-all registration is removed by a null name
         mbean.removeAttributeChangeNotificationListener(listener, null);
         listener.received.clear();
@@ -132,7 +138,9 @@ public class TestBaseModelMBeanNotifications {
         mbean.addAttributeChangeNotificationListener(listener, "A", "hb");
         mbean.removeAttributeChangeNotificationListener(listener, "Z");
         send(mbean, "A");
-        Assert.assertEquals(List.of("A:hb"), listener.received);
+        List<String> list = new ArrayList<>();
+        list.add("A:hb");
+        Assert.assertEquals(list, listener.received);
     }
 
     @Test
@@ -145,7 +153,9 @@ public class TestBaseModelMBeanNotifications {
         mbean.removeAttributeChangeNotificationListener(listener1, "A");
         send(mbean, "A");
         Assert.assertTrue(listener1.received.isEmpty());
-        Assert.assertEquals(List.of("A:hb"), listener2.received);
+        List<String> list = new ArrayList<>();
+        list.add("A:hb");
+        Assert.assertEquals(list, listener2.received);
     }
 
     @Test
@@ -201,6 +211,8 @@ public class TestBaseModelMBeanNotifications {
         mbean.addNotificationListener(listener, acceptAll, "hb");
         mbean.removeAttributeChangeNotificationListener(listener, "A");
         send(mbean, "A");
-        Assert.assertEquals(List.of("A:hb"), listener.received);
+        List<String> list = new ArrayList<>();
+        list.add("A:hb");
+        Assert.assertEquals(list, listener.received);
     }
 }
diff --git a/test/org/apache/tomcat/util/net/TestLargeClientHello.java 
b/test/org/apache/tomcat/util/net/TestLargeClientHello.java
index 83dbfa68f1..afe4215611 100644
--- a/test/org/apache/tomcat/util/net/TestLargeClientHello.java
+++ b/test/org/apache/tomcat/util/net/TestLargeClientHello.java
@@ -17,7 +17,6 @@
 
 package org.apache.tomcat.util.net;
 
-import java.io.File;
 import java.io.OutputStream;
 import java.net.InetSocketAddress;
 import java.net.Socket;


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

Reply via email to