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

commit 9c02e8f12140a556c77c9134f0096b98e3762c46
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Oct 23 12:29:23 2026 +0100

    Fix IDE warnings
---
 .../tribes/tipis/TestAbstractReplicatedMap.java    | 47 ++++++++++------------
 .../tribes/tipis/TestLazyReplicatedMap.java        | 22 +++++-----
 2 files changed, 31 insertions(+), 38 deletions(-)

diff --git 
a/test/org/apache/catalina/tribes/tipis/TestAbstractReplicatedMap.java 
b/test/org/apache/catalina/tribes/tipis/TestAbstractReplicatedMap.java
index f0a714741a..f7b5307bbe 100644
--- a/test/org/apache/catalina/tribes/tipis/TestAbstractReplicatedMap.java
+++ b/test/org/apache/catalina/tribes/tipis/TestAbstractReplicatedMap.java
@@ -408,9 +408,9 @@ public class TestAbstractReplicatedMap {
             Member sender = new MemberImpl("localhost", 4017, -1);
 
             // Round trip over the serialization to get a message with the key 
data but no live key
-            byte[] wire = XByteBuffer.serialize(new MapMessage(
-                    
"TestAbstractReplicatedMap".getBytes(StandardCharsets.UTF_8), 
MapMessage.MSG_RETRIEVE_BACKUP, false,
-                    key, null, null, null, null));
+            byte[] wire =
+                    XByteBuffer.serialize(new 
MapMessage("TestAbstractReplicatedMap".getBytes(StandardCharsets.UTF_8),
+                            MapMessage.MSG_RETRIEVE_BACKUP, false, key, null, 
null, null, null));
 
             MapMessage received = (MapMessage) XByteBuffer.deserialize(wire);
             Serializable reply = map.replyRequest(received, sender);
@@ -441,16 +441,15 @@ public class TestAbstractReplicatedMap {
     }
 
     /*
-     * A key may implement Serializable and still fail to serialize, which the 
message construction
-     * reports as an unchecked exception. That must not abort the removal 
either.
+     * A key may implement Serializable and still fail to serialize, which the 
message construction reports as an
+     * unchecked exception. That must not abort the removal either.
      */
     @Test
     public void testRemoveUnserializableKeyDoesNotThrow() throws Exception {
         TestChannel channel = new TestChannel();
-        LazyReplicatedMap<Object,String> map = new 
LazyReplicatedMap<Object,String>(
-                (key, value) -> {
-                    // Not made primary here
-                }, channel, 1000, "TestAbstractReplicatedMap", null);
+        LazyReplicatedMap<Object,String> map = new LazyReplicatedMap<>((key, 
value) -> {
+            // Not made primary here
+        }, channel, 1000, "TestAbstractReplicatedMap", null);
         map.memberAlive(new MemberImpl("localhost", 4019, -1));
 
         // The put keeps the entry on this node, as it cannot be published to 
a backup
@@ -466,10 +465,9 @@ public class TestAbstractReplicatedMap {
     @Test
     public void testPutUnserializableKeyReplicatedMapKeepsEntryLocal() throws 
Exception {
         TestChannel channel = new TestChannel();
-        ReplicatedMap<Object,String> map = new ReplicatedMap<Object,String>(
-                (key, value) -> {
-                    // Not made primary here
-                }, channel, 1000, "TestAbstractReplicatedMap", null);
+        ReplicatedMap<Object,String> map = new ReplicatedMap<>((key, value) -> 
{
+            // Not made primary here
+        }, channel, 1000, "TestAbstractReplicatedMap", null);
         Member first = new MemberImpl("localhost", 4020, -1);
         Member second = new MemberImpl("localhost", 4021, -1);
         map.memberAlive(first);
@@ -489,10 +487,9 @@ public class TestAbstractReplicatedMap {
     @Test
     public void testMemberDisappearedSkipsNonSerializableEntry() throws 
Exception {
         TestChannel channel = new TestChannel();
-        ReplicatedMap<Object,String> map = new ReplicatedMap<Object,String>(
-                (key, value) -> {
-                    // Not made primary here
-                }, channel, 1000, "TestAbstractReplicatedMap", null);
+        ReplicatedMap<Object,String> map = new ReplicatedMap<>((key, value) -> 
{
+            // Not made primary here
+        }, channel, 1000, "TestAbstractReplicatedMap", null);
         Member first = new MemberImpl("localhost", 4024, -1);
         Member second = new MemberImpl("localhost", 4025, -1);
         map.memberAlive(first);
@@ -510,10 +507,9 @@ public class TestAbstractReplicatedMap {
 
     @Test
     public void testStateRequestSkipsUnserializableEntry() throws Exception {
-        LazyReplicatedMap<Object,String> map = new 
LazyReplicatedMap<Object,String>(
-                (key, value) -> {
-                    // Not made primary here
-                }, new TestChannel(), 1000, "TestAbstractReplicatedMap", null);
+        LazyReplicatedMap<Object,String> map = new LazyReplicatedMap<>((key, 
value) -> {
+            // Not made primary here
+        }, new TestChannel(), 1000, "TestAbstractReplicatedMap", null);
         map.put("good", "value");
         map.put(new FailingKey(), "local");
 
@@ -531,10 +527,9 @@ public class TestAbstractReplicatedMap {
 
     @Test
     public void testBackupRequestSkipsUnserializableValue() throws Exception {
-        LazyReplicatedMap<String,Object> map = new 
LazyReplicatedMap<String,Object>(
-                (key, value) -> {
-                    // Not made primary here
-                }, new TestChannel(), 1000, "TestAbstractReplicatedMap", null);
+        LazyReplicatedMap<String,Object> map = new LazyReplicatedMap<>((key, 
value) -> {
+            // Not made primary here
+        }, new TestChannel(), 1000, "TestAbstractReplicatedMap", null);
         map.put("key", new FailingKey());
 
         MapMessage backupRequest = new 
MapMessage("TestAbstractReplicatedMap".getBytes(StandardCharsets.UTF_8),
@@ -547,7 +542,7 @@ public class TestAbstractReplicatedMap {
 
         private static final long serialVersionUID = 1L;
 
-        private void writeObject(ObjectOutputStream out) throws IOException {
+        private void writeObject(@SuppressWarnings("unused") 
ObjectOutputStream out) throws IOException {
             throw new IOException("Cannot be serialized");
         }
     }
diff --git a/test/org/apache/catalina/tribes/tipis/TestLazyReplicatedMap.java 
b/test/org/apache/catalina/tribes/tipis/TestLazyReplicatedMap.java
index facb9168ca..77eb1555b1 100644
--- a/test/org/apache/catalina/tribes/tipis/TestLazyReplicatedMap.java
+++ b/test/org/apache/catalina/tribes/tipis/TestLazyReplicatedMap.java
@@ -26,20 +26,19 @@ import org.apache.catalina.tribes.membership.MemberImpl;
 public class TestLazyReplicatedMap {
 
     /*
-     * The backup node selection snapshots the members and computes an index 
in two steps. A member
-     * added in between must not let the index point behind the end of the 
snapshot, which aborted
-     * the publication with an array index out of bounds exception, losing the 
entry that was being
-     * stored. The index is computed for the size of the snapshot.
+     * The backup node selection snapshots the members and computes an index 
in two steps. A member added in between
+     * must not let the index point behind the end of the snapshot, which 
aborted the publication with an array index
+     * out of bounds exception, losing the entry that was being stored. The 
index is computed for the size of the
+     * snapshot.
      */
     @Test
     public void testBackupIndexWithinMemberSnapshot() throws Exception {
         Member member = new MemberImpl("localhost", 4007, -1);
         Member other = new MemberImpl("localhost", 4008, -1);
 
-        LazyReplicatedMap<String,String> map = new 
LazyReplicatedMap<String,String>(
-                (key, value) -> {
-                    // Not made primary here
-                }, new GroupChannel(), 1000, "TestLazyReplicatedMap", null) {
+        LazyReplicatedMap<String,String> map = new LazyReplicatedMap<>((key, 
value) -> {
+            // Not made primary here
+        }, new GroupChannel(), 1000, "TestLazyReplicatedMap", null) {
 
             @Override
             public Member[] getMapMembers() {
@@ -59,10 +58,9 @@ public class TestLazyReplicatedMap {
 
     @Test
     public void testNextBackupIndexClampsToSize() {
-        LazyReplicatedMap<String,String> map = new 
LazyReplicatedMap<String,String>(
-                (key, value) -> {
-                    // Not made primary here
-                }, new GroupChannel(), 1000, "TestLazyReplicatedMap", null);
+        LazyReplicatedMap<String,String> map = new LazyReplicatedMap<>((key, 
value) -> {
+            // Not made primary here
+        }, new GroupChannel(), 1000, "TestLazyReplicatedMap", null);
 
         Assert.assertEquals(-1, map.getNextBackupIndex(0));
         Assert.assertEquals(0, map.getNextBackupIndex(3));


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

Reply via email to