mirror of
https://github.com/DanilaFe/abacus
synced 2026-09-25 12:52:33 +00:00
Do not use null in exceptions and add messages to exceptions.
This commit is contained in:
@@ -3,7 +3,7 @@ package org.nwapw.abacus.exception;
|
||||
public class AbacusException extends RuntimeException {
|
||||
|
||||
public AbacusException(String baseMessage, String description){
|
||||
super(baseMessage + ((description == null) ? "." : (": " + description)));
|
||||
super(baseMessage + ((description.equals("")) ? "." : (": " + description)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public class ComputationInterruptedException extends AbacusException {
|
||||
* Creates a new exception of this type.
|
||||
*/
|
||||
public ComputationInterruptedException() {
|
||||
super("Computation interrupted", null);
|
||||
super("Computation interrupted", "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class DomainException extends AbacusException {
|
||||
* Creates a new DomainException with a default message.
|
||||
*/
|
||||
public DomainException(){
|
||||
this(null);
|
||||
this("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public class EvaluationException extends AbacusException {
|
||||
* Creates a new EvaluationException with the default string.
|
||||
*/
|
||||
public EvaluationException() {
|
||||
this(null);
|
||||
this("");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user