diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java index 11796a0ab..e51d9c156 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/PacketIDFilter.java @@ -35,7 +35,7 @@ public class PacketIDFilter implements PacketFilter { * Creates a new packet ID filter using the specified packet's ID. * * @param packet the packet which the ID is taken from. - * @deprecated use {@link StanzaIdfilter(Stanza)} instead. + * @deprecated use {@link StanzaIdFilter#StanzaIdFilter(Stanza)} instead. */ @Deprecated public PacketIDFilter(Stanza packet) { @@ -46,7 +46,7 @@ public class PacketIDFilter implements PacketFilter { * Creates a new packet ID filter using the specified packet ID. * * @param packetID the packet ID to filter for. - * @deprecated use {@link StanzaIdFilter(String)} instead. + * @deprecated use {@link StanzaIdFilter#StanzaIdFilter(Stanza)} instead. */ @Deprecated public PacketIDFilter(String packetID) { diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/BundleAndDefer.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/BundleAndDefer.java index ad899f9e5..8fb585541 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/BundleAndDefer.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/BundleAndDefer.java @@ -27,6 +27,14 @@ public class BundleAndDefer { this.isStopped = isStopped; } + /** + * Stop the bundle and defer mechanism that was started when this instance of {@link BundleAndDefer} was emitted by + * Smack. + *

+ * It is possible that the defer period already expired when this is invoked. In this case this method is basically + * a no-op. + *

+ */ public void stopCurrentBundleAndDefer() { synchronized (isStopped) { if (isStopped.get()) { 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 f8852f1ad..774a5e24c 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 @@ -185,8 +185,19 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { private final SynchronizationPoint compressSyncPoint = new SynchronizationPoint( this); + /** + * The default bundle and defer callback, used for new connections. + * @see bundleAndDeferCallback + */ private static BundleAndDeferCallback defaultBundleAndDeferCallback; + /** + * The used bundle and defer callback. + *

+ * Although this field may be set concurrently, the 'volatile' keyword was deliberately not added, in order to avoid + * having a 'volatile' read within the writer threads loop. + *

+ */ private BundleAndDeferCallback bundleAndDeferCallback = defaultBundleAndDeferCallback; private static boolean useSmDefault = false;