Fixed bug in deletion of valid conn descriptor once different clients with same ID connects (issues #116 and #124)

This commit is contained in:
andsel
2015-12-27 13:19:16 +01:00
parent 571eaa1378
commit 163858e47b
7 changed files with 94 additions and 5 deletions
@@ -38,4 +38,23 @@ public class ConnectionDescriptor {
public String toString() {
return "ConnectionDescriptor{" + "clientID=" + clientID + ", cleanSession=" + cleanSession + '}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ConnectionDescriptor that = (ConnectionDescriptor) o;
if (clientID != null ? !clientID.equals(that.clientID) : that.clientID != null) return false;
return !(session != null ? !session.equals(that.session) : that.session != null);
}
@Override
public int hashCode() {
int result = clientID != null ? clientID.hashCode() : 0;
result = 31 * result + (session != null ? session.hashCode() : 0);
return result;
}
}