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-logging.git


The following commit(s) were added to refs/heads/master by this push:
     new e2f9a3f  Deprecate LogConfigurationException.cause in favor of 
getCause()
e2f9a3f is described below

commit e2f9a3fce80bf74c756e0191843d2d4fc40e4372
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Nov 19 11:34:18 2023 -0500

    Deprecate LogConfigurationException.cause in favor of getCause()
---
 src/changes/changes.xml                            |  3 +++
 .../commons/logging/LogConfigurationException.java | 23 ++++++++--------------
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e192205..c3071cb 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -79,6 +79,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" issue="LOGGING-185" dev="ggregory" due-to="Piotr P. 
Karwasz">
         Fix failing tests #180.
       </action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">
+        Deprecate LogConfigurationException.cause in favor of getCause().
+      </action>
       <!-- UPDATE -->
       <action dev="ggregory" type="update" due-to="Gary Gregory">
         Bump Java from 6 to 8.
diff --git 
a/src/main/java/org/apache/commons/logging/LogConfigurationException.java 
b/src/main/java/org/apache/commons/logging/LogConfigurationException.java
index d3034ac..1612fac 100644
--- a/src/main/java/org/apache/commons/logging/LogConfigurationException.java
+++ b/src/main/java/org/apache/commons/logging/LogConfigurationException.java
@@ -18,9 +18,7 @@
 package org.apache.commons.logging;
 
 /**
- * An exception that is thrown only if a suitable {@code LogFactory}
- * or {@code Log} instance cannot be created by the corresponding
- * factory methods.
+ * An exception that is thrown only if a suitable {@code LogFactory} or {@code 
Log} instance cannot be created by the corresponding factory methods.
  */
 public class LogConfigurationException extends RuntimeException {
 
@@ -29,7 +27,10 @@ public class LogConfigurationException extends 
RuntimeException {
 
     /**
      * The underlying cause of this exception.
+     *
+     * @deprecated Use {@link #getCause()}.
      */
+    @Deprecated
     protected Throwable cause;
 
     /**
@@ -51,16 +52,15 @@ public class LogConfigurationException extends 
RuntimeException {
      * Constructs a new exception with the specified detail message and cause.
      *
      * @param message The detail message
-     * @param cause The underlying cause
+     * @param cause   The underlying cause
      */
     public LogConfigurationException(final String message, final Throwable 
cause) {
-        super(message + " (Caused by " + cause + ")");
-        this.cause = cause; // Two-argument version requires JDK 1.4 or later
+        super(message, cause);
+        this.cause = cause;
     }
 
     /**
-     * Constructs a new exception with the specified cause and a derived
-     * detail message.
+     * Constructs a new exception with the specified cause and a derived 
detail message.
      *
      * @param cause The underlying cause
      */
@@ -68,11 +68,4 @@ public class LogConfigurationException extends 
RuntimeException {
         this(cause == null ? null : cause.toString(), cause);
     }
 
-    /**
-     * Return the underlying cause of this exception (if any).
-     */
-    @Override
-    public Throwable getCause() {
-        return this.cause;
-    }
 }

Reply via email to