langtools/src/share/classes/com/sun/tools/javac/util/Pair.java
changeset 1789 7ac8c0815000
parent 10 06bc494ca11e
child 5520 86e4b9a9da40
equal deleted inserted replaced
1788:ced0a1a7ec80 1789:7ac8c0815000
    50         return (x == null && y == null) || (x != null && x.equals(y));
    50         return (x == null && y == null) || (x != null && x.equals(y));
    51     }
    51     }
    52 
    52 
    53     public boolean equals(Object other) {
    53     public boolean equals(Object other) {
    54         return
    54         return
    55             other instanceof Pair &&
    55             other instanceof Pair<?,?> &&
    56             equals(fst, ((Pair)other).fst) &&
    56             equals(fst, ((Pair<?,?>)other).fst) &&
    57             equals(snd, ((Pair)other).snd);
    57             equals(snd, ((Pair<?,?>)other).snd);
    58     }
    58     }
    59 
    59 
    60     public int hashCode() {
    60     public int hashCode() {
    61         if (fst == null) return (snd == null) ? 0 : snd.hashCode() + 1;
    61         if (fst == null) return (snd == null) ? 0 : snd.hashCode() + 1;
    62         else if (snd == null) return fst.hashCode() + 2;
    62         else if (snd == null) return fst.hashCode() + 2;