|
|
@@ -1,13 +1,10 @@
|
|
|
package jplag;
|
|
|
-/*
|
|
|
- * Created on 05.03.2005 Author Moritz Kroll, Emeric Kwemou
|
|
|
- */
|
|
|
|
|
|
/**
|
|
|
* Exception to be reached through to the main caller of JPlag to replace the "exit" method
|
|
|
+ * @apiNote Created on 05.03.2005 Author Moritz Kroll, Emeric Kwemou.
|
|
|
*/
|
|
|
public class ExitException extends Exception {
|
|
|
- // public static final int PACKAGING_RESULTS = 201;
|
|
|
public static final int COMPARE_SOURCE_DONE = 300;
|
|
|
public static final int UNKNOWN_ERROR_OCCURRED = 400;
|
|
|
public static final int BAD_LANGUAGE_ERROR = 401;
|
|
|
@@ -17,30 +14,32 @@ public class ExitException extends Exception {
|
|
|
public static final int SUBMISSION_ABORTED = 405;
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
- private int state = 0;
|
|
|
- private String report = "";
|
|
|
+ private final int errorCode;
|
|
|
+ private final String message;
|
|
|
|
|
|
- public ExitException(String msg) {
|
|
|
- super(msg);
|
|
|
- this.state = UNKNOWN_ERROR_OCCURRED;
|
|
|
- this.report = msg;
|
|
|
+ public ExitException(String message) {
|
|
|
+ super(message);
|
|
|
+ errorCode = UNKNOWN_ERROR_OCCURRED;
|
|
|
+ this.message = message;
|
|
|
}
|
|
|
|
|
|
- public ExitException(String msg, int errorcode) {
|
|
|
- super(msg);
|
|
|
- this.state = errorcode;
|
|
|
- this.report = msg;
|
|
|
+ public ExitException(String message, int errorCode) {
|
|
|
+ super(message);
|
|
|
+ this.errorCode = errorCode;
|
|
|
+ this.message = message;
|
|
|
}
|
|
|
|
|
|
- public ExitException(String msg, Throwable cause) {
|
|
|
- super(msg, cause);
|
|
|
+ public ExitException(String message, Throwable cause) {
|
|
|
+ super(message, cause);
|
|
|
+ errorCode = UNKNOWN_ERROR_OCCURRED;
|
|
|
+ this.message = message;
|
|
|
}
|
|
|
|
|
|
public int getState() {
|
|
|
- return this.state;
|
|
|
+ return errorCode;
|
|
|
}
|
|
|
|
|
|
public String getReport() {
|
|
|
- return this.report;
|
|
|
+ return message;
|
|
|
}
|
|
|
}
|