From: Frederic Suter Date: Tue, 28 Jun 2016 07:59:04 +0000 (+0200) Subject: ValueOf -> parse X-Git-Tag: v3_14~845^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4ff58d2d07010304fcec536391550de4ff5e0682 ValueOf -> parse --- diff --git a/examples/java/app/bittorrent/Peer.java b/examples/java/app/bittorrent/Peer.java index 58b4b489d4..0bdc770232 100644 --- a/examples/java/app/bittorrent/Peer.java +++ b/examples/java/app/bittorrent/Peer.java @@ -50,12 +50,12 @@ public class Peer extends Process { Msg.info("Wrong number of arguments"); } if (args.length == 3) { - init(Integer.valueOf(args[0]),true); + init(Integer.parseInt(args[0]),true); } else { - init(Integer.valueOf(args[0]),false); + init(Integer.parseInt(args[0]),false); } //Retrieve the deadline - deadline = Double.valueOf(args[1]); + deadline = Double.parseDouble(args[1]); if (deadline < 0) { Msg.info("Wrong deadline supplied"); return; diff --git a/examples/java/app/bittorrent/Tracker.java b/examples/java/app/bittorrent/Tracker.java index f613bb9ca9..c6a1862b83 100644 --- a/examples/java/app/bittorrent/Tracker.java +++ b/examples/java/app/bittorrent/Tracker.java @@ -34,7 +34,7 @@ public class Tracker extends Process { //Build the RngStream object for randomness stream = new RngStream("tracker"); //Retrieve the end time - deadline = Double.valueOf(args[0]); + deadline = Double.parseDouble(args[0]); //Building peers array peersList = new ArrayList<>(); diff --git a/examples/java/dht/kademlia/Node.java b/examples/java/dht/kademlia/Node.java index 25124b6408..ba7bee29a8 100644 --- a/examples/java/dht/kademlia/Node.java +++ b/examples/java/dht/kademlia/Node.java @@ -33,13 +33,13 @@ public class Node extends Process { Msg.info("Wrong argument count."); return; } - this.id = Integer.valueOf(args[0]); + this.id = Integer.parseInt(args[0]); this.table = new RoutingTable(this.id); if (args.length == 3) { - this.deadline = Integer.valueOf(args[2]).intValue(); + this.deadline = Integer.parseInt(args[2]); Msg.info("Hi, I'm going to join the network with the id " + id + "!"); - if (joinNetwork(Integer.valueOf(args[1]))) { + if (joinNetwork(Integer.parseInt(args[1]))) { this.mainLoop(); } else { @@ -47,7 +47,7 @@ public class Node extends Process { } } else { - this.deadline = Integer.valueOf(args[1]).intValue(); + this.deadline = Integer.parseInt(args[1]); Msg.info("Hi, I'm going to create the network with the id " + id + "!"); table.update(this.id); this.mainLoop(); diff --git a/examples/java/process/startkilltime/Sleeper.java b/examples/java/process/startkilltime/Sleeper.java index fe1310e5f5..7a30764f6d 100644 --- a/examples/java/process/startkilltime/Sleeper.java +++ b/examples/java/process/startkilltime/Sleeper.java @@ -18,7 +18,7 @@ public class Sleeper extends Process { public void main(String[] args) throws MsgException { Msg.info("Hello! I go to sleep."); try { - waitFor(Integer.valueOf(args[0]).intValue()); + waitFor(Integer.parseInt(args[0])); Msg.info("Done sleeping"); } catch (MsgException e) { Msg.debug("Wait cancelled."); diff --git a/examples/java/task/priority/Test.java b/examples/java/task/priority/Test.java index 7edd279f3c..3d10a04a0f 100644 --- a/examples/java/task/priority/Test.java +++ b/examples/java/task/priority/Test.java @@ -20,8 +20,8 @@ public class Test extends Process { double computationAmount = 1.0; double priority = 1.0; - computationAmount = Double.valueOf(args[0]); - priority = Double.valueOf(args[1]); + computationAmount = Double.parseDouble(args[0]); + priority = Double.parseDouble(args[1]); Msg.info("Hello! Running a task of size " + computationAmount + " with priority " + priority);