Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove some smells in Java
[simgrid.git] / examples / java / app / pingpong / Sender.java
index 9644b4d..ab23c66 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2014, 2016. 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
@@ -13,8 +13,7 @@ import org.simgrid.msg.NativeException;
 import org.simgrid.msg.HostNotFoundException;
 
 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 {
     super(hostname,name,args);
@@ -35,8 +34,8 @@ public class Sender extends Process {
       try {
         mailboxes[pos] = Host.getByName(args[pos]).getName();
       } catch (HostNotFoundException e) {
+        e.printStackTrace();
         Msg.info("Invalid deployment file: " + e.toString());
-        System.exit(1);
       }
     }
 
@@ -45,7 +44,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]);