1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 22:32:06 +01:00

Use Objects.requireNonNull() in BytestreamSIDFilter

This commit is contained in:
Florian Schmaus 2015-02-18 09:27:27 +01:00
parent 98cfad6cc6
commit 33cf205bdc

View file

@ -32,6 +32,7 @@ import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.filter.PacketTypeFilter; import org.jivesoftware.smack.filter.PacketTypeFilter;
import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.Objects;
import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager; import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager;
import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamRequest; import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamRequest;
import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamSession; import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamSession;
@ -127,14 +128,11 @@ public class Socks5TransferNegotiator extends StreamNegotiator {
*/ */
private static class BytestreamSIDFilter extends PacketTypeFilter { private static class BytestreamSIDFilter extends PacketTypeFilter {
private String sessionID; private final String sessionID;
public BytestreamSIDFilter(String sessionID) { public BytestreamSIDFilter(String sessionID) {
super(Bytestream.class); super(Bytestream.class);
if (sessionID == null) { this.sessionID = Objects.requireNonNull(sessionID, "SessionID cannot be null");
throw new IllegalArgumentException("StreamID cannot be null");
}
this.sessionID = sessionID;
} }
@Override @Override