diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2020-03-16 17:59:07 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2020-03-16 17:59:07 +0100 |
commit | 6ff563f3f8b8777d5f879819d59642fc859abc71 (patch) | |
tree | 5e610d75e6f13772e16727eedf393c5eeb074abc /vespajlib | |
parent | 2ee38ab4e8be0ea9a7c8405111d93212679501a4 (diff) |
Only log once per hour per cluster
Diffstat (limited to 'vespajlib')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/collections/Pair.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/collections/Pair.java b/vespajlib/src/main/java/com/yahoo/collections/Pair.java index 506ad10b98e..6587d1804f9 100644 --- a/vespajlib/src/main/java/com/yahoo/collections/Pair.java +++ b/vespajlib/src/main/java/com/yahoo/collections/Pair.java @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.collections; +import java.util.Objects; + /** * An immutable pair of objects. This implements equals and hashCode by delegating to the * pair objects. @@ -33,19 +35,13 @@ public class Pair<F, S> { } @Override - public boolean equals(final Object o) { + public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Pair)) return false; @SuppressWarnings("rawtypes") - final Pair other = (Pair) o; - return equals(this.first, other.first) - && equals(this.second, other.second); - } - - private static boolean equals(final Object a, final Object b) { - if (a == null) return b == null; - return a.equals(b); + Pair other = (Pair) o; + return Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second); } @Override |