some coding practice and potential bug fixes

This commit is contained in:
Thialfihar
2010-05-27 20:27:21 +00:00
parent 570b7a6d8e
commit b42f02ba92
4 changed files with 40 additions and 9 deletions

View File

@@ -10,6 +10,12 @@ public class CachedPassPhrase {
this.passPhrase = passPhrase;
}
public int hashCode() {
int hc1 = (int)(this.timestamp & 0xffffffff);
int hc2 = (this.passPhrase == null ? 0 : this.passPhrase.hashCode());
return (hc1 + hc2) * hc2 + hc1;
}
public boolean equals(Object other) {
if (!(other instanceof CachedPassPhrase)) {
return false;