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

Make sendStanza() final

This commit is contained in:
Florian Schmaus 2019-02-04 09:49:51 +01:00
parent 5705f18f58
commit dc780ffd6c
2 changed files with 3 additions and 5 deletions

View file

@ -738,9 +738,8 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
}
}
// TODO: This method should be final.
@Override
public void sendStanza(Stanza stanza) throws NotConnectedException, InterruptedException {
public final void sendStanza(Stanza stanza) throws NotConnectedException, InterruptedException {
Objects.requireNonNull(stanza, "Stanza must not be null");
assert (stanza instanceof Message || stanza instanceof Presence || stanza instanceof IQ);

View file

@ -23,7 +23,6 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.IQ.Type;
import org.jivesoftware.smack.packet.Message;
@ -42,8 +41,8 @@ public class ThreadedDummyConnection extends DummyConnection {
private volatile boolean timeout = false;
@Override
public void sendStanza(Stanza packet) throws NotConnectedException, InterruptedException {
super.sendStanza(packet);
protected void sendStanzaInternal(Stanza packet) {
super.sendStanzaInternal(packet);
if (packet instanceof IQ && !timeout) {
timeout = false;