Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
java: kill obscure NativeException
[simgrid.git] / examples / java / app / tokenring / RelayRunner.java
index 0f1bf9c..f3b43ba 100644 (file)
@@ -4,23 +4,22 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 package app.tokenring;
+import org.simgrid.msg.Host;
 import org.simgrid.msg.Msg;
-import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;
 import org.simgrid.msg.MsgException;
-import org.simgrid.msg.NativeException;
-import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
+import org.simgrid.msg.Process;
+import org.simgrid.msg.Task;
 
 public class RelayRunner extends Process {
 
        private static final int TASK_COMM_SIZE = 1000000; /* The token is 1MB long*/
 
-       public RelayRunner(Host host, String name, String[]args) throws HostNotFoundException, NativeException{
+       public RelayRunner(Host host, String name, String[]args) {
                super(host,name,args);
        }
 
        /* This is the function executed by this kind of processes */
+       @Override
        public void main(String[] args) throws MsgException {
                // In this example, the processes are given numerical names: "0", "1", "2", and so on 
                int rank = Integer.parseInt(this.getName());
@@ -45,7 +44,7 @@ public class RelayRunner extends Process {
                        
                    Msg.info("Host '"+rank+"' received '"+token.getName()+"'");
 
-                   String mailbox = ""+(rank+1); // Java idiomatic to get the String version of rank+1
+                   String mailbox = Integer.toString(rank+1);
                    if (rank+1 == Host.getCount()) {
                        /* The last process has no right neighbor, so it sends the token back to rank 0 */
                        mailbox = "0";