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 b90e335d48a3f0512fa02cb982ac9de1fa55f0a7
Author: remm <[email protected]>
AuthorDate: Tue Oct 20 23:33:11 2026 +0200

    Compatibility
---
 java/org/apache/tomcat/buildutil/Txt2Html.java     |  1 -
 .../apache/naming/factory/TestLookupFactory.java   | 32 +++++++++++++++++-----
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/tomcat/buildutil/Txt2Html.java 
b/java/org/apache/tomcat/buildutil/Txt2Html.java
index a61ab337df..a08dd9c6f8 100644
--- a/java/org/apache/tomcat/buildutil/Txt2Html.java
+++ b/java/org/apache/tomcat/buildutil/Txt2Html.java
@@ -23,7 +23,6 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
 import java.io.Writer;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
diff --git a/test/org/apache/naming/factory/TestLookupFactory.java 
b/test/org/apache/naming/factory/TestLookupFactory.java
index 4af5e7ebeb..b73bbe7682 100644
--- a/test/org/apache/naming/factory/TestLookupFactory.java
+++ b/test/org/apache/naming/factory/TestLookupFactory.java
@@ -63,7 +63,7 @@ public class TestLookupFactory extends TomcatBaseTest {
         container.bind("comp/env/ref", new LookupRef(MARKER_CLASS, 
"java:comp/env/target"));
 
         Object found = new 
javax.naming.InitialContext().lookup("java:comp/env/ref");
-        Assert.assertSame(webapp.marker(), found);
+        Assert.assertSame(webapp.getMarker(), found);
     }
 
 
@@ -79,10 +79,10 @@ public class TestLookupFactory extends TomcatBaseTest {
         ejb.setType("Session");
         ejb.setLookupName("java:comp/env/target");
         ejb.setRemote(MARKER_CLASS);
-        webapp.listener().addEjb(ejb);
+        webapp.getListener().addEjb(ejb);
 
         Object found = new 
javax.naming.InitialContext().lookup("java:comp/env/ejb");
-        Assert.assertSame(webapp.marker(), found);
+        Assert.assertSame(webapp.getMarker(), found);
     }
 
 
@@ -118,7 +118,7 @@ public class TestLookupFactory extends TomcatBaseTest {
         ejb.setLookupName("java:comp/env/target");
         // The object bound as the target is not an instance of this interface
         ejb.setRemote(String.class.getName());
-        webapp.listener().addEjb(ejb);
+        webapp.getListener().addEjb(ejb);
 
         try {
             Object found = new 
javax.naming.InitialContext().lookup("java:comp/env/ejb");
@@ -186,8 +186,8 @@ public class TestLookupFactory extends TomcatBaseTest {
         // The context of the web application is read only once it is started
         NamingContextListener listener = null;
         for (LifecycleListener lifecycleListener : 
ctx.findLifecycleListeners()) {
-            if (lifecycleListener instanceof NamingContextListener 
namingContextListener) {
-                listener = namingContextListener;
+            if (lifecycleListener instanceof NamingContextListener) {
+                listener = (NamingContextListener) lifecycleListener;
             }
         }
         Assert.assertNotNull(listener);
@@ -225,6 +225,24 @@ public class TestLookupFactory extends TomcatBaseTest {
      * The listener which binds the naming resources of the web application and
      * the instance of the class which only that web application can see.
      */
-    private record TesterWebapp(NamingContextListener listener, Object marker) 
{
+    private class TesterWebapp {
+        private final NamingContextListener listener;
+        private final Object marker;
+        TesterWebapp(NamingContextListener listener, Object marker) {
+            this.listener = listener;
+            this.marker = marker;
+        }
+        /**
+         * @return the listener
+         */
+        public NamingContextListener getListener() {
+            return this.listener;
+        }
+        /**
+         * @return the marker
+         */
+        public Object getMarker() {
+            return this.marker;
+        }
     }
 }


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

Reply via email to