Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tidy the exceptions that can be raised by our Java code
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 1 Aug 2017 23:52:04 +0000 (01:52 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 1 Aug 2017 23:52:08 +0000 (01:52 +0200)
Thx, sonar

examples/java/app/bittorrent/Main.java
examples/java/cloud/migration/XVM.java
examples/java/dht/kademlia/Main.java
examples/java/io/file/Node.java
examples/java/io/storage/Client.java
src/bindings/java/org/simgrid/msg/Msg.java
src/bindings/java/org/simgrid/msg/Process.java

index b918505..091b6ec 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2014,2016. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -15,7 +14,7 @@ class Main{
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws MsgException {
+  public static void main(String[] args) {
     int[] seed = { 12345, 12345, 12345, 12345, 12345, 12345 };
     RngStream.setPackageSeed(seed);
 
index 3cc30ea..10b3164 100644 (file)
@@ -40,11 +40,7 @@ public class XVM extends VM {
 
   public void start(){
     super.start();
-    try {
-      daemon.start();
-    } catch (HostNotFoundException e) {
-      e.printStackTrace();
-    }
+    daemon.start();
     this.setLoad(0);
   }
 
index dacbfae..1474e55 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2014, 2016. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -13,7 +12,7 @@ class Main {
     throw new IllegalAccessError("Utility class");
   }
 
-  public static void main(String[] args) throws MsgException {
+  public static void main(String[] args) {
     Msg.init(args);
     if(args.length < 2) {
       Msg.info("Usage   : Kademlia platform_file deployment_file");
index 706c3b9..c1622cd 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2014. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -33,7 +32,7 @@ public class Node extends Process {
 
   protected int rank;
 
-  public Node(Host host, int number) throws HostNotFoundException {
+  public Node(Host host, int number) {
     super(host, Integer.toString(number), null);
     this.rank = number;
   }
index e3e6fcd..b031faa 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2012-2014. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -24,7 +23,7 @@ import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.MsgException;
 
 public class Client extends Process {
-  public Client(Host host, int number) throws HostNotFoundException {
+  public Client(Host host, int number) {
     super(host, Integer.toString(number), null);
   }
 
index b53f5b5..0cc18d0 100644 (file)
@@ -1,7 +1,6 @@
 /* JNI interface to C code for MSG. */
 
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -61,7 +60,7 @@ public final class Msg {
         * @param args
         * @throws MsgException
         */
-       public static void main(String[]args) throws MsgException {
+       public static void main(String[]args) {
                /* initialize the MSG simulation. Must be done before anything else (even logging). */
                Msg.init(args);
 
index 43dc342..055939e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -283,9 +282,9 @@ public abstract class Process implements Runnable {
         * It is a noop if the process is already launched.
         * @throws HostNotFoundException
         */
-       public final void start() throws HostNotFoundException {
-               if (bind == 0)
-                        create(host);
+       public final void start() {
+          if (bind == 0)
+            create(host);
        }
 
        /** This method runs the process. It calls the method function that you must overwrite. */