mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-08 20:10:00 +00:00
Remove unnecessary overrides of equals/hashCode in Cache.Entry
This commit is contained in:
parent
64727b78de
commit
8c05d4f43d
@ -139,24 +139,6 @@ public class Cache<K, V> {
|
||||
this.value = value;
|
||||
this.writeTime = this.accessTime = writeTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
} else if (!(obj instanceof Entry)) {
|
||||
return false;
|
||||
} else {
|
||||
@SuppressWarnings("unchecked")
|
||||
Entry<K, V> e = (Entry<K, V>) obj;
|
||||
return Objects.equals(key, e.key);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user