From 9520aa7d90f7ca80828eeed9ed980db1525c4a1e Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 15 Mar 2021 19:24:19 +0100 Subject: [PATCH] [sinttest] Do not create myReceiveMarkers on demand --- .../igniterealtime/smack/XmppConnectionStressTest.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java index 5a6192fd9..adc0a5be9 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java @@ -134,6 +134,9 @@ public class XmppConnectionStressTest { Map> receiveMarkers = new ConcurrentHashMap<>(connections.size()); for (XMPPConnection connection : connections) { + final Map myReceiveMarkers = new HashMap<>(connections.size()); + receiveMarkers.put(connection, myReceiveMarkers); + connection.addSyncStanzaListener(new StanzaListener() { @Override public void processStanza(Stanza stanza) { @@ -145,12 +148,6 @@ public class XmppConnectionStressTest { Integer messageNumber = (Integer) extension.getProperty(MESSAGE_NUMBER_PROPERTY); - Map myReceiveMarkers = receiveMarkers.get(connection); - if (myReceiveMarkers == null) { - myReceiveMarkers = new HashMap<>(connections.size()); - receiveMarkers.put(connection, myReceiveMarkers); - } - boolean[] fromMarkers = myReceiveMarkers.get(from); if (fromMarkers == null) { fromMarkers = new boolean[configuration.messagesPerConnection];