use of sun.rmi.transport.tcp.TCPEndpoint in project jdk8u_jdk by JetBrains.
the class LiveRef method remoteEquals.
public boolean remoteEquals(Object obj) {
if (obj != null && obj instanceof LiveRef) {
LiveRef ref = (LiveRef) obj;
TCPEndpoint thisEp = ((TCPEndpoint) ep);
TCPEndpoint refEp = ((TCPEndpoint) ref.ep);
RMIClientSocketFactory thisClientFactory = thisEp.getClientSocketFactory();
RMIClientSocketFactory refClientFactory = refEp.getClientSocketFactory();
/**
* Fix for 4254103: LiveRef.remoteEquals should not fail
* if one of the objects in the comparison has a null
* server socket. Comparison should only consider the
* following criteria:
*
* hosts, ports, client socket factories and object IDs.
*/
if (thisEp.getPort() != refEp.getPort() || !thisEp.getHost().equals(refEp.getHost())) {
return false;
}
if ((thisClientFactory == null) ^ (refClientFactory == null)) {
return false;
}
if ((thisClientFactory != null) && !((thisClientFactory.getClass() == refClientFactory.getClass()) && (thisClientFactory.equals(refClientFactory)))) {
return false;
}
return (id.equals(ref.id));
} else {
return false;
}
}
Aggregations