Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more argument checking
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 20 Jan 2016 09:47:45 +0000 (10:47 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 20 Jan 2016 09:49:45 +0000 (10:49 +0100)
src/bindings/java/org/simgrid/msg/Process.java

index 5e53e74..502348c 100644 (file)
@@ -146,6 +146,8 @@ public abstract class Process implements Runnable {
        public Process(Host host, String name, String[]args) {
                this();
                this.host = host;
        public Process(Host host, String name, String[]args) {
                this();
                this.host = host;
+               if (host == null)
+                       throw new NullPointerException("Process name cannot be NULL");
                if (name == null)
                        throw new NullPointerException("Process name cannot be NULL");
                this.name = name;
                if (name == null)
                        throw new NullPointerException("Process name cannot be NULL");
                this.name = name;
@@ -168,6 +170,8 @@ public abstract class Process implements Runnable {
        public Process(Host host, String name, String[]args, double startTime, double killTime) {
                this();
                this.host = host;
        public Process(Host host, String name, String[]args, double startTime, double killTime) {
                this();
                this.host = host;
+               if (host == null)
+                       throw new NullPointerException("Process name cannot be NULL");
                if (name == null)
                        throw new NullPointerException("Process name cannot be NULL");
                this.name = name;
                if (name == null)
                        throw new NullPointerException("Process name cannot be NULL");
                this.name = name;