Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
java: kill obscure NativeException
[simgrid.git] / examples / java / app / pingpong / Sender.java
index 03782b2..d352069 100644 (file)
@@ -5,18 +5,16 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 package app.pingpong;
-import org.simgrid.msg.Msg;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
-import org.simgrid.msg.NativeException;
 import org.simgrid.msg.HostNotFoundException;
+import org.simgrid.msg.Msg;
+import org.simgrid.msg.MsgException;
+import org.simgrid.msg.Process;
 
 public class Sender extends Process {
-  private final double commSizeLat = 1;
-  final double commSizeBw = 100000000;
+  private static final double COMM_SIZE_LAT = 1;
 
-  public Sender(String hostname, String name, String[] args) throws HostNotFoundException, NativeException {
+  public Sender(String hostname, String name, String[] args) throws HostNotFoundException {
     super(hostname,name,args);
   }
 
@@ -26,7 +24,7 @@ public class Sender extends Process {
     int hostCount = args.length;
 
     Msg.info("host count: " + hostCount);
-    String mailboxes[] = new String[hostCount]; 
+    String[] mailboxes = new String[hostCount]; 
     double time;
     double computeDuration = 0;
     PingPongTask task;
@@ -45,7 +43,7 @@ public class Sender extends Process {
 
       Msg.info("sender time: " + time);
 
-      task = new PingPongTask("no name",computeDuration,commSizeLat);
+      task = new PingPongTask("no name",computeDuration,COMM_SIZE_LAT);
       task.setTime(time);
 
       task.send(mailboxes[pos]);