From cc758b8f591c9517571058b45ae0f888c64b2dd6 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 21 Oct 2015 16:03:45 +0200 Subject: [PATCH] Use ackedStanzasCount instead of handledCount in processHandledCount for the initial size of the ackedStanzas list. Thanks to Juan Antonio for reporting. --- .../main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index cb1a3216b..cd4e320c6 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -1758,7 +1758,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { private void processHandledCount(long handledCount) throws StreamManagementCounterError { long ackedStanzasCount = SMUtils.calculateDelta(handledCount, serverHandledStanzasCount); final List ackedStanzas = new ArrayList( - handledCount <= Integer.MAX_VALUE ? (int) handledCount + ackedStanzasCount <= Integer.MAX_VALUE ? (int) ackedStanzasCount : Integer.MAX_VALUE); for (long i = 0; i < ackedStanzasCount; i++) { Stanza ackedStanza = unacknowledgedStanzas.poll();