This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new d4bbf5cecc Fix IDE warnings
d4bbf5cecc is described below
commit d4bbf5cecc4823b6a286628c84b3b20be4fccccc
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 6dd8a069c6..6bda504aec 100644
--- a/test/org/apache/catalina/tribes/tipis/TestAbstractReplicatedMap.java
+++ b/test/org/apache/catalina/tribes/tipis/TestAbstractReplicatedMap.java
@@ -410,9 +410,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);
@@ -443,16 +443,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
@@ -468,10 +467,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);
@@ -491,10 +489,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);
@@ -512,10 +509,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");
@@ -533,10 +529,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),
@@ -551,7 +546,7 @@ public class TestAbstractReplicatedMap {
private static final long serialVersionUID = 1L;
@Serial
- 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]