From: Frederic Suter Date: Tue, 31 May 2016 07:43:44 +0000 (+0200) Subject: cosmetics X-Git-Tag: v3_14~1089 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e6db01ae48bc7732c60c93be30c2278679f5434f cosmetics --- diff --git a/examples/java/app/pingpong/Main.java b/examples/java/app/pingpong/Main.java index 3352474d6b..9a049c2e06 100644 --- a/examples/java/app/pingpong/Main.java +++ b/examples/java/app/pingpong/Main.java @@ -10,7 +10,7 @@ import org.simgrid.msg.HostNotFoundException; import org.simgrid.msg.NativeException; class Main { - public static void main(String[] args) throws HostNotFoundException,NativeException{ + public static void main(String[] args) throws HostNotFoundException, NativeException{ Msg.init(args); if(args.length < 1) { Msg.info("Usage : Main platform_file"); diff --git a/examples/java/app/pingpong/Receiver.java b/examples/java/app/pingpong/Receiver.java index e4469b3c23..4e59a48674 100644 --- a/examples/java/app/pingpong/Receiver.java +++ b/examples/java/app/pingpong/Receiver.java @@ -13,8 +13,8 @@ import org.simgrid.msg.NativeException; import org.simgrid.msg.HostNotFoundException; public class Receiver extends Process { - static final double commSizeLat = 1; - static final double commSizeBw = 100000000; + static final double COMM_SIZE_LAT = 1; + static final double COMM_SIZE_BW = 100000000; public Receiver(String hostname, String name, String[]args) throws HostNotFoundException, NativeException{ super(hostname,name,args); } @@ -36,7 +36,7 @@ public class Receiver extends Process { double communicationTime = timeGot - time; Msg.info("Communication time : " + communicationTime); - Msg.info(" --- bw "+ commSizeBw/communicationTime + " ----"); + Msg.info(" --- bw "+ COMM_SIZE_BW/communicationTime + " ----"); Msg.info("goodbye!"); } } \ No newline at end of file diff --git a/examples/java/cloud/masterworker/Master.java b/examples/java/cloud/masterworker/Master.java index c783dec801..b5200ca11a 100644 --- a/examples/java/cloud/masterworker/Master.java +++ b/examples/java/cloud/masterworker/Master.java @@ -25,7 +25,7 @@ public class Master extends Process { public void main(String[] args) throws MsgException { int workersCount = Main.hostNB; - ArrayList vms = new ArrayList(); + ArrayList vms = new ArrayList<>(); // Create one VM per host and bind a process inside each one. for (int i = 0; i < workersCount; i++) { @@ -79,8 +79,8 @@ public class Master extends Process { Msg.info("Let's shut down the simulation and kill everyone."); for (int i = 0; i < vms.size(); i++) { - vms.get(i).shutdown(); - vms.get(i).finalize(); + vms.get(i).shutdown(); + vms.get(i).finalize(); } Msg.info("Master done."); } diff --git a/examples/java/energy/vm/EnergyVMRunner.java b/examples/java/energy/vm/EnergyVMRunner.java index b7a2102388..4094a20ff7 100644 --- a/examples/java/energy/vm/EnergyVMRunner.java +++ b/examples/java/energy/vm/EnergyVMRunner.java @@ -30,6 +30,7 @@ public class EnergyVMRunner extends Process { try { task.execute(); } catch (HostFailureException | TaskCancelledException e) { + Msg.error(e.getMessage()); e.printStackTrace(); } Msg.info("This worker is done."); @@ -41,10 +42,7 @@ public class EnergyVMRunner extends Process { } @Override - public void main(String[] strings) throws MsgException, HostNotFoundException { - double startTime = 0; - double endTime = 0; - + public void main(String[] strings) throws HostNotFoundException, HostFailureException { /* get hosts */ Host host1 = Host.getByName("MyHost1"); Host host2 = Host.getByName("MyHost2");