1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 10:37:59 +01:00

[sinttest] Do not create myReceiveMarkers on demand

This commit is contained in:
Florian Schmaus 2021-03-15 19:24:19 +01:00
parent 11a486d84d
commit 9520aa7d90

View file

@ -134,6 +134,9 @@ public class XmppConnectionStressTest {
Map<XMPPConnection, Map<EntityFullJid, boolean[]>> receiveMarkers = new ConcurrentHashMap<>(connections.size()); Map<XMPPConnection, Map<EntityFullJid, boolean[]>> receiveMarkers = new ConcurrentHashMap<>(connections.size());
for (XMPPConnection connection : connections) { for (XMPPConnection connection : connections) {
final Map<EntityFullJid, boolean[]> myReceiveMarkers = new HashMap<>(connections.size());
receiveMarkers.put(connection, myReceiveMarkers);
connection.addSyncStanzaListener(new StanzaListener() { connection.addSyncStanzaListener(new StanzaListener() {
@Override @Override
public void processStanza(Stanza stanza) { public void processStanza(Stanza stanza) {
@ -145,12 +148,6 @@ public class XmppConnectionStressTest {
Integer messageNumber = (Integer) extension.getProperty(MESSAGE_NUMBER_PROPERTY); Integer messageNumber = (Integer) extension.getProperty(MESSAGE_NUMBER_PROPERTY);
Map<EntityFullJid, boolean[]> myReceiveMarkers = receiveMarkers.get(connection);
if (myReceiveMarkers == null) {
myReceiveMarkers = new HashMap<>(connections.size());
receiveMarkers.put(connection, myReceiveMarkers);
}
boolean[] fromMarkers = myReceiveMarkers.get(from); boolean[] fromMarkers = myReceiveMarkers.get(from);
if (fromMarkers == null) { if (fromMarkers == null) {
fromMarkers = new boolean[configuration.messagesPerConnection]; fromMarkers = new boolean[configuration.messagesPerConnection];