Made equals proper

This commit is contained in:
Ellpeck 2016-06-05 12:55:27 +02:00
parent e2e2241e63
commit ff70e6d53d

View file

@ -188,8 +188,8 @@ public class LaserRelayConnectionHandler{
public boolean equals(Object obj){
if(obj instanceof ConnectionPair){
ConnectionPair pair = (ConnectionPair)obj;
if(this.firstRelay != null && this.firstRelay.equals(pair.firstRelay)){
if(this.secondRelay != null && this.secondRelay.equals(pair.secondRelay)){
if(this.firstRelay == pair.firstRelay || (this.firstRelay != null && this.firstRelay.equals(pair.firstRelay))){
if(this.secondRelay == pair.secondRelay && (this.secondRelay != null && this.secondRelay.equals(pair.secondRelay))){
return true;
}
}