Ticket #269: Removed equals() and hashCode() from MySQLConnection (now present in AbstractConnection).

This commit is contained in:
Michael Jumper
2013-02-26 20:26:46 -08:00
parent 611a613589
commit 6a74e62caa

View File

@@ -154,25 +154,6 @@ public class MySQLConnection extends AbstractConnection {
return socket; return socket;
} }
@Override
public boolean equals(Object other) {
if(!(other instanceof MySQLConnection))
return false;
boolean idsAreEqual = ((MySQLConnection)other).getConnectionID() == this.getConnectionID();
// they are both new, check if they have the same name
if(idsAreEqual && this.getConnectionID() == 0)
return this.getIdentifier().equals(((MySQLConnection)other).getIdentifier());
return idsAreEqual;
}
@Override
public int hashCode() {
int hash = 7;
hash = 73 * hash + getConnectionID();
hash = 73 * hash + getIdentifier().hashCode();
return hash;
}
@Override @Override
public List<? extends ConnectionRecord> getHistory() throws GuacamoleException { public List<? extends ConnectionRecord> getHistory() throws GuacamoleException {
return Collections.unmodifiableList(history); return Collections.unmodifiableList(history);