This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git
The following commit(s) were added to refs/heads/master by this push:
new 185d5a4 Javadoc.
185d5a4 is described below
commit 185d5a4f352ce9157fe69cf6f6b0cffe153bffb2
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Nov 18 07:55:38 2020 -0500
Javadoc.
---
.../org/apache/commons/daemon/DaemonInitException.java | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/daemon/DaemonInitException.java
b/src/main/java/org/apache/commons/daemon/DaemonInitException.java
index aa9114f..1dbeaec 100644
--- a/src/main/java/org/apache/commons/daemon/DaemonInitException.java
+++ b/src/main/java/org/apache/commons/daemon/DaemonInitException.java
@@ -25,7 +25,7 @@ public class DaemonInitException extends Exception {
private static final long serialVersionUID = 5665891535067213551L;
/**
- * Constructs a new exception with the specified message.
+ * Constructs a new exception with the given message.
*
* @param message the detail message accessible with {@link #getMessage()}
.
*/
@@ -33,13 +33,24 @@ public class DaemonInitException extends Exception {
super(message);
}
+ /**
+ * Constructs a new exception with the given detail and cause.
+ *
+ * @param message the detail message accessible with {@link #getMessage()}
.
+ * @param cause the cause accessible with {@link #getCause()}.
+ */
public DaemonInitException(final String message, final Throwable cause) {
super(message, cause);
}
+ /**
+ * Gets the message with the cause as a postfix.
+ *
+ * @return the message with the cause as a postfix.
+ */
public String getMessageWithCause() {
- final String extra = getCause() == null ? "" : ": " +
getCause().getMessage();
- return getMessage() + extra;
+ final Throwable cause = getCause();
+ return getMessage() + (cause == null ? "" : ": " + cause.getMessage());
}
}