Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Smelly code, smelly code, how are they writing you
[simgrid.git] / src / bindings / java / org / simgrid / msg / Process.java
index 5c55f10..291ab60 100644 (file)
@@ -47,9 +47,7 @@ public abstract class Process implements Runnable {
         * access to it. It is set automatically during the build of the object.
         */
        private long bind;
-       /**
-        * Indicates if the process is started
-        */
+       /** Indicates if the process is started */
        boolean started;
        /**
         * Even if this attribute is public you must never access to it.
@@ -66,8 +64,7 @@ public abstract class Process implements Runnable {
 
        /** Time at which the process should be created  */
        protected double startTime = 0;
-       /** Time at which th
-        * Kill time of the process
+       /** Time at which the process should be killed.
         * 
         * Set at creation, and used internally by SimGrid
         */
@@ -83,9 +80,7 @@ public abstract class Process implements Runnable {
        public Vector<String> args;
 
 
-       /**
-        * Default constructor
-        */
+       /**  Default constructor */
        protected Process() {
                this.id = nextProcessId++;
                this.name = null;
@@ -146,6 +141,8 @@ public abstract class Process implements Runnable {
        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;
@@ -168,6 +165,8 @@ public abstract class Process implements Runnable {
        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;
@@ -324,13 +323,11 @@ public abstract class Process implements Runnable {
                }
        }
 
-       /**
-        * This method runs the process. Il calls the method function that you must overwrite.
-        */
+       /** This method runs the process. Il calls the method function that you must overwrite. */
+       @Override
        public void run() {
 
                String[] args = null;      /* do not fill it before the signal or this.args will be empty */
-               //waitSignal(); /* wait for other people to fill the process in */
 
                try {
                        args = new String[this.args.size()];
@@ -357,13 +354,13 @@ public abstract class Process implements Runnable {
         */
        public abstract void main(String[]args) throws MsgException;
 
-       public native void exit();    
+       public native void exit();
        /**
         * Class initializer, to initialize various JNI stuff
         */
        private static native void nativeInit();
        static {
-               Msg.nativeInit();
+               org.simgrid.NativeLib.nativeInit();
                nativeInit();
        }
        /**