Don't make unnecessary assumptions of Object to be compared
Missing @Override git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1032018 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5b243bb64d
commit
36b8beb614
|
@ -87,8 +87,7 @@ public class Pair<K, V> {
|
|||
if (!(o instanceof Pair)) {
|
||||
return false;
|
||||
} else {
|
||||
Pair<? extends K, ? extends V> oP
|
||||
= (Pair<? extends K, ? extends V>) o;
|
||||
Pair<?, ?> oP = (Pair<?, ? >) o;
|
||||
return (key == null ?
|
||||
oP.getKey() == null :
|
||||
key.equals(oP.getKey())) &&
|
||||
|
@ -103,6 +102,7 @@ public class Pair<K, V> {
|
|||
*
|
||||
* @return the hash code value.
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (key == null ? 0 : key.hashCode()) ^
|
||||
(value == null ? 0 : value.hashCode());
|
||||
|
|
Loading…
Reference in New Issue