From: Frederic Suter Date: Thu, 26 Apr 2018 12:35:13 +0000 (+0200) Subject: I see brain overload ... X-Git-Tag: v3.20~317 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6f07f2a2696cf881ba0ff5cc2361ca22c29d57ee?ds=sidebyside I see brain overload ... --- diff --git a/examples/java/app/bittorrent/Peer.java b/examples/java/app/bittorrent/Peer.java index 978619f869..9188edd11b 100644 --- a/examples/java/app/bittorrent/Peer.java +++ b/examples/java/app/bittorrent/Peer.java @@ -178,16 +178,15 @@ public class Peer extends Process { private boolean getPeersData() { boolean success = false; - boolean sendSuccess = false; double timeout = Msg.getClock() + Common.GET_PEERS_TIMEOUT; //Build the task to send to the tracker TrackerTask taskSend = new TrackerTask(hostname, mailboxTracker, id); - while (!sendSuccess && Msg.getClock() < timeout) { + while (Msg.getClock() < timeout) { try { Msg.debug("Sending a peer request to the tracker."); taskSend.send(Common.TRACKER_MAILBOX,Common.GET_PEERS_TIMEOUT); - sendSuccess = true; + break; } catch (MsgException e) { e.printStackTrace(); @@ -212,7 +211,6 @@ public class Peer extends Process { } commReceived = null; } - commReceived = null; return success; }