From: Frederic Suter Date: Tue, 31 May 2016 10:45:08 +0000 (+0200) Subject: remove blocker in kademlia X-Git-Tag: v3_14~1086 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6e62251874be4829dedb958e8f2530f1a943d42c remove blocker in kademlia --- diff --git a/examples/java/dht/kademlia/Contact.java b/examples/java/dht/kademlia/Contact.java index b52dcfbc84..2c9658df5e 100644 --- a/examples/java/dht/kademlia/Contact.java +++ b/examples/java/dht/kademlia/Contact.java @@ -25,7 +25,15 @@ public class Contact implements Comparable { @Override public boolean equals(Object x) { - return x.equals(id) ; + return (x == null) ? false : x.equals(id) ; + } + + @Override + public int hashCode() { + int hash = 1; + hash = hash * 17 + id; + hash = hash * 31 + distance; + return hash; } @Override