A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Smelly code, smelly code, how are they writing you
[simgrid.git]
/
src
/
bindings
/
java
/
org
/
simgrid
/
msg
/
Process.java
diff --git
a/src/bindings/java/org/simgrid/msg/Process.java
b/src/bindings/java/org/simgrid/msg/Process.java
index
5c55f10
..
291ab60
100644
(file)
--- a/
src/bindings/java/org/simgrid/msg/Process.java
+++ b/
src/bindings/java/org/simgrid/msg/Process.java
@@
-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;
* 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.
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 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
*/
*
* Set at creation, and used internally by SimGrid
*/
@@
-83,9
+80,7
@@
public abstract class Process implements Runnable {
public Vector<String> args;
public Vector<String> args;
- /**
- * Default constructor
- */
+ /** Default constructor */
protected Process() {
this.id = nextProcessId++;
this.name = null;
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;
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
+165,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;
@@
-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 */
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()];
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 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 {
/**
* Class initializer, to initialize various JNI stuff
*/
private static native void nativeInit();
static {
-
Msg
.nativeInit();
+
org.simgrid.NativeLib
.nativeInit();
nativeInit();
}
/**
nativeInit();
}
/**