From: Frederic Suter Date: Tue, 5 Jul 2016 07:38:15 +0000 (+0200) Subject: fix bug raised by rriemann. X-Git-Tag: v3_14~812 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/61f6dd0c87cb650a987bf861e93f8fc8ae795769 fix bug raised by rriemann. --- diff --git a/examples/java/app/bittorrent/Tracker.java b/examples/java/app/bittorrent/Tracker.java index c6a1862b83..980d9c6117 100644 --- a/examples/java/app/bittorrent/Tracker.java +++ b/examples/java/app/bittorrent/Tracker.java @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2014, 2026. The SimGrid Team. +/* Copyright (c) 2006-2014, 2016. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ public class Tracker extends Process { int nextPeer; do { nextPeer = stream.randInt(0, peersList.size() - 1); - } while (tTask.peers.contains(nextPeer)); + } while (tTask.peers.contains(peersList.get(nextPeer))); tTask.peers.add(peersList.get(nextPeer)); nbPeers++; } diff --git a/examples/java/app/bittorrent/app_bittorrent.tesh b/examples/java/app/bittorrent/app_bittorrent.tesh index 06e28450dd..b6662d0ba9 100644 --- a/examples/java/app/bittorrent/app_bittorrent.tesh +++ b/examples/java/app/bittorrent/app_bittorrent.tesh @@ -17,8 +17,8 @@ $ java -classpath ${classpath:=.} app/bittorrent/Main ${srcdir:=.}/../platforms/ > [node-4.acme.org:app.bittorrent.Peer:(5) 0.000000] [jmsg/INFO] Hi, I'm joining the network with id 5 > [node-4.acme.org:app.bittorrent.Peer:(5) 5000.007806] [jmsg/INFO] Here is my current status: 1111111111 > [node-5.acme.org:app.bittorrent.Peer:(6) 0.000000] [jmsg/INFO] Hi, I'm joining the network with id 6 -> [node-5.acme.org:app.bittorrent.Peer:(6) 5000.039030] [jmsg/INFO] Here is my current status: 1111111111 +> [node-5.acme.org:app.bittorrent.Peer:(6) 5000.023418] [jmsg/INFO] Here is my current status: 1111111111 > [node-6.acme.org:app.bittorrent.Peer:(7) 0.000000] [jmsg/INFO] Hi, I'm joining the network with id 7 -> [node-6.acme.org:app.bittorrent.Peer:(7) 5000.031224] [jmsg/INFO] Here is my current status: 1111111111 +> [node-6.acme.org:app.bittorrent.Peer:(7) 5000.046836] [jmsg/INFO] Here is my current status: 1111111111 > [node-7.acme.org:app.bittorrent.Peer:(8) 0.000000] [jmsg/INFO] Hi, I'm joining the network with id 8 -> [node-7.acme.org:app.bittorrent.Peer:(8) 5000.046836] [jmsg/INFO] Here is my current status: 1111111111 +> [node-7.acme.org:app.bittorrent.Peer:(8) 5000.031224] [jmsg/INFO] Here is my current status: 1111111111