X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dccf1b41e9c7b5a696f01abceaa2779fe65f154f..e2b455e834089e4512c6311872052ba441b487ec:/examples/java/dht/kademlia/Answer.java?ds=sidebyside diff --git a/examples/java/dht/kademlia/Answer.java b/examples/java/dht/kademlia/Answer.java index 1421529b86..7a348311e8 100644 --- a/examples/java/dht/kademlia/Answer.java +++ b/examples/java/dht/kademlia/Answer.java @@ -16,18 +16,18 @@ public class Answer { public Answer(int destinationId) { this.destinationId = destinationId; - nodes = new ArrayList(); + nodes = new ArrayList<>(); } - int getDestinationId() { + protected int getDestinationId() { return destinationId; } - ArrayList getNodes() { + protected ArrayList getNodes() { return nodes; } - int size() { + protected int size() { return nodes.size(); } @@ -59,7 +59,7 @@ public class Answer { /* Returns if the destination has been found */ public boolean destinationFound() { - if (nodes.size() < 1) { + if (nodes.isEmpty()) { return false; } Contact tail = nodes.get(0);