1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-19 10:32:05 +01:00

[core] Add requireNonNull() check to some connection endpoints

This commit is contained in:
Florian Schmaus 2020-11-14 12:41:58 +01:00
parent c4228e072b
commit f10cbb4a97
2 changed files with 6 additions and 4 deletions

View file

@ -19,6 +19,7 @@ package org.jivesoftware.smack.tcp.rce;
import java.net.InetAddress;
import org.jivesoftware.smack.datatypes.UInt16;
import org.jivesoftware.smack.util.Objects;
import org.jivesoftware.smack.util.rce.SingleAddressRemoteConnectionEndpoint;
import org.minidns.record.InternetAddressRR;
@ -33,9 +34,9 @@ public final class IpTcpRemoteConnectionEndpoint<IARR extends InternetAddressRR<
private final IARR internetAddressResourceRecord;
public IpTcpRemoteConnectionEndpoint(CharSequence host, UInt16 port, IARR internetAddressResourceRecord) {
this.host = host;
this.port = port;
this.internetAddressResourceRecord = internetAddressResourceRecord;
this.host = Objects.requireNonNull(host);
this.port = Objects.requireNonNull(port);
this.internetAddressResourceRecord = Objects.requireNonNull(internetAddressResourceRecord);
}
public static IpTcpRemoteConnectionEndpoint<InternetAddressRR<?>> from(CharSequence host, UInt16 port,

View file

@ -21,6 +21,7 @@ import java.util.Collection;
import java.util.List;
import org.jivesoftware.smack.datatypes.UInt16;
import org.jivesoftware.smack.util.Objects;
import org.jivesoftware.smack.util.rce.RemoteConnectionEndpoint;
import org.minidns.record.SRV;
@ -36,7 +37,7 @@ public abstract class SrvRemoteConnectionEndpoint implements RemoteConnectionEnd
protected SrvRemoteConnectionEndpoint(SRV srv, List<? extends InetAddress> inetAddresses) {
this.srv = srv;
this.port = UInt16.from(srv.port);
this.inetAddresses = inetAddresses;
this.inetAddresses = Objects.requireNonNull(inetAddresses);
}
@Override