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 c71632cc12 Fix IDE warnings
c71632cc12 is described below

commit c71632cc12eb362a6e0820135ccc532116f2c884
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Oct 22 15:40:56 2026 +0100

    Fix IDE warnings
---
 test/org/apache/juli/logging/TesterLogNoStringConstructor.java | 2 --
 test/org/apache/juli/logging/TesterLogStringConstructor.java   | 4 +---
 test/org/apache/naming/TestNamingContext.java                  | 2 +-
 test/org/apache/naming/TestSelectorContextConcurrency.java     | 2 +-
 test/org/apache/naming/factory/TestLookupFactory.java          | 3 ++-
 5 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/test/org/apache/juli/logging/TesterLogNoStringConstructor.java 
b/test/org/apache/juli/logging/TesterLogNoStringConstructor.java
index 454703102b..4f18cf2af6 100644
--- a/test/org/apache/juli/logging/TesterLogNoStringConstructor.java
+++ b/test/org/apache/juli/logging/TesterLogNoStringConstructor.java
@@ -23,8 +23,6 @@ package org.apache.juli.logging;
  */
 public class TesterLogNoStringConstructor implements Log {
 
-    private static final long serialVersionUID = 1L;
-
     @Override
     public boolean isDebugEnabled() {
         return false;
diff --git a/test/org/apache/juli/logging/TesterLogStringConstructor.java 
b/test/org/apache/juli/logging/TesterLogStringConstructor.java
index 50b0628721..09828e21fe 100644
--- a/test/org/apache/juli/logging/TesterLogStringConstructor.java
+++ b/test/org/apache/juli/logging/TesterLogStringConstructor.java
@@ -23,13 +23,11 @@ package org.apache.juli.logging;
  */
 public class TesterLogStringConstructor implements Log {
 
-    private static final long serialVersionUID = 1L;
-
     public TesterLogStringConstructor() {
         // Required no-argument constructor for the ServiceLoader
     }
 
-    public TesterLogStringConstructor(String name) {
+    public TesterLogStringConstructor(@SuppressWarnings("unused") String name) 
{
         // Used by LogFactory to create the instance for the given name
     }
 
diff --git a/test/org/apache/naming/TestNamingContext.java 
b/test/org/apache/naming/TestNamingContext.java
index c3aae8dc30..670d2d92ee 100644
--- a/test/org/apache/naming/TestNamingContext.java
+++ b/test/org/apache/naming/TestNamingContext.java
@@ -101,7 +101,7 @@ public class TestNamingContext extends TomcatBaseTest {
     public void testResourceLinkWithoutGlobalName() {
         // Use a private context to keep the global context validation out of
         // the way, whatever test order is used within the JVM
-        Context context = new NamingContext(new Hashtable<String,Object>(), 
"test");
+        Context context = new NamingContext(new Hashtable<>(), "test");
         ResourceLinkFactory.setGlobalContext(context);
 
         // A resource link without a global name is a configuration error that
diff --git a/test/org/apache/naming/TestSelectorContextConcurrency.java 
b/test/org/apache/naming/TestSelectorContextConcurrency.java
index e1f4c86c9e..8ab8b13094 100644
--- a/test/org/apache/naming/TestSelectorContextConcurrency.java
+++ b/test/org/apache/naming/TestSelectorContextConcurrency.java
@@ -131,7 +131,7 @@ public class TestSelectorContextConcurrency {
         private static final long serialVersionUID = 1L;
 
         @Override
-        public Enumeration<String> keys() {
+        public synchronized Enumeration<String> keys() {
             try {
                 Thread.sleep(200);
             } catch (InterruptedException e) {
diff --git a/test/org/apache/naming/factory/TestLookupFactory.java 
b/test/org/apache/naming/factory/TestLookupFactory.java
index b73bbe7682..de66706eaf 100644
--- a/test/org/apache/naming/factory/TestLookupFactory.java
+++ b/test/org/apache/naming/factory/TestLookupFactory.java
@@ -88,7 +88,7 @@ public class TestLookupFactory extends TomcatBaseTest {
 
     @Test
     public void testTypeMismatchIsStillReported() throws Exception {
-        TesterWebapp webapp = startWebapp();
+        startWebapp();
 
         Context container = ContextBindings.getClassLoader();
         container.bind("comp/env/ref", new LookupRef(String.class.getName(), 
"java:comp/env/target"));
@@ -174,6 +174,7 @@ public class TestLookupFactory extends TomcatBaseTest {
         Files.createDirectories(source.getParent());
         Files.write(source, ("package tester;\npublic class Marker 
{\n}\n".getBytes(StandardCharsets.UTF_8)));
         ByteArrayOutputStream compilerOutput = new ByteArrayOutputStream();
+        @SuppressWarnings("null")
         int result = compiler.run(null, compilerOutput, compilerOutput, "-d", 
classes.toString(),
                 source.toString());
         Assert.assertEquals("The class of the web application could not be 
compiled: " + compilerOutput, 0, result);


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

Reply via email to