diff --git a/imixs-workflow-core/src/main/java/org/imixs/workflow/exceptions/PluginException.java b/imixs-workflow-core/src/main/java/org/imixs/workflow/exceptions/PluginException.java index bc7885db3..f359195ed 100644 --- a/imixs-workflow-core/src/main/java/org/imixs/workflow/exceptions/PluginException.java +++ b/imixs-workflow-core/src/main/java/org/imixs/workflow/exceptions/PluginException.java @@ -37,7 +37,6 @@ public class PluginException extends WorkflowException { private static final long serialVersionUID = 1L; - private java.lang.Object[] params = null; public PluginException(String aErrorContext, String aErrorCode, String message) { super(aErrorContext, aErrorCode, message); @@ -56,22 +55,4 @@ public PluginException(String aErrorContext, String aErrorCode, String message, this.params = params; } - public Object[] getErrorParameters() { - return params; - } - - protected void setErrorParameters(java.lang.Object[] aparams) { - this.params = aparams; - } - - @Override - public String formatErrorMessageWithParameters(String message){ - if (params != null && params.length > 0) { - for (int i = 0; i < params.length; i++) { - message = message.replace("{" + i + "}", params[i].toString()); - } - } - - return message; - } } diff --git a/imixs-workflow-core/src/main/java/org/imixs/workflow/exceptions/WorkflowException.java b/imixs-workflow-core/src/main/java/org/imixs/workflow/exceptions/WorkflowException.java index 7a5436e36..753d1d965 100644 --- a/imixs-workflow-core/src/main/java/org/imixs/workflow/exceptions/WorkflowException.java +++ b/imixs-workflow-core/src/main/java/org/imixs/workflow/exceptions/WorkflowException.java @@ -41,32 +41,28 @@ public abstract class WorkflowException extends Exception { protected String errorContext = "UNDEFINED"; protected String errorCode = "UNDEFINED"; + protected java.lang.Object[] params = null; public WorkflowException(String aErrorCode, String message) { super(message); errorCode = aErrorCode; - } public WorkflowException(String aErrorContext, String aErrorCode, String message) { super(message); errorContext = aErrorContext; errorCode = aErrorCode; - } public WorkflowException(String aErrorContext, String aErrorCode, String message, Exception e) { super(message, e); errorContext = aErrorContext; errorCode = aErrorCode; - } public WorkflowException(String aErrorCode, String message, Exception e) { super(message, e); - errorCode = aErrorCode; - } public String getErrorContext() { @@ -85,7 +81,20 @@ public void setErrorCode(String errorCode) { this.errorCode = errorCode; } - public String formatErrorMessageWithParameters(String message){ + public Object[] getErrorParameters() { + return params; + } + + protected void setErrorParameters(java.lang.Object[] aparams) { + this.params = aparams; + } + + public String formatErrorMessageWithParameters(String message) { + if (params != null && params.length > 0) { + for (int i = 0; i < params.length; i++) { + message = message.replace("{" + i + "}", params[i].toString()); + } + } return message; } } diff --git a/imixs-workflow-faces/src/main/java/org/imixs/workflow/faces/util/ValidationException.java b/imixs-workflow-faces/src/main/java/org/imixs/workflow/faces/util/ValidationException.java index 1280e1c72..7c76260f2 100644 --- a/imixs-workflow-faces/src/main/java/org/imixs/workflow/faces/util/ValidationException.java +++ b/imixs-workflow-faces/src/main/java/org/imixs/workflow/faces/util/ValidationException.java @@ -40,7 +40,6 @@ public class ValidationException extends WorkflowException { private static final long serialVersionUID = 1L; - private java.lang.Object[] params = null; public ValidationException(String aErrorContext, String aErrorCode, String message) { super(aErrorContext, aErrorCode, message); @@ -52,26 +51,7 @@ public ValidationException(String aErrorContext, String aErrorCode, String messa public ValidationException(String aErrorContext, String aErrorCode, String message, Object[] params) { super(aErrorContext, aErrorCode, message); - this.params = params; - } - - public java.lang.Object[] getErrorParameters() { - return params; - } - - protected void setErrorParameters(Object[] aparams) { - this.params = aparams; - } - - @Override - public String formatErrorMessageWithParameters(String message){ - if (params != null && params.length > 0) { - for (int i = 0; i < params.length; i++) { - message = message.replace("{" + i + "}", params[i].toString()); - } - } - - return message; + this.setErrorParameters(params); } }