jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r374383 - /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/BaseException.java
Date Thu, 02 Feb 2006 13:51:40 GMT
Author: jukka
Date: Thu Feb  2 05:51:37 2006
New Revision: 374383

URL: http://svn.apache.org/viewcvs?rev=374383&view=rev
Log:
Use the standard exception root cause mechanism included in JDK 1.4.

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/BaseException.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/BaseException.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/BaseException.java?rev=374383&r1=374382&r2=374383&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/BaseException.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/BaseException.java
Thu Feb  2 05:51:37 2006
@@ -16,9 +16,6 @@
  */
 package org.apache.jackrabbit;
 
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
 /**
  * The abstract class <code>BaseException</code> serves as the base class
  * for all exceptions that are specific to this JCR implementation and that
@@ -27,17 +24,11 @@
 public abstract class BaseException extends Exception {
 
     /**
-     * Root failure cause
-     */
-    private final Throwable rootCause;
-
-    /**
      * Constructs a new instance of this class with <code>null</code> as its
      * detail message.
      */
     public BaseException() {
         super();
-        rootCause = null;
     }
 
     /**
@@ -49,7 +40,6 @@
      */
     public BaseException(String message) {
         super(message);
-        rootCause = null;
     }
 
     /**
@@ -61,8 +51,7 @@
      * @param rootCause root failure cause
      */
     public BaseException(String message, Throwable rootCause) {
-        super(message);
-        this.rootCause = rootCause;
+        super(message, rootCause);
     }
 
     /**
@@ -71,87 +60,7 @@
      * @param rootCause root failure cause
      */
     public BaseException(Throwable rootCause) {
-        super();
-        this.rootCause = rootCause;
-    }
-
-    /**
-     * Returns the detail message, including the message from the nested
-     * exception if there is one.
-     *
-     * @return the detail message (which may be <code>null</code>).
-     */
-    public String getMessage() {
-        String s = super.getMessage();
-        if (rootCause == null) {
-            return s;
-        } else if (s == null) {
-            return rootCause.getMessage();
-        } else {
-            return s + ": " + rootCause.getMessage();
-        }
-    }
-
-    /**
-     * Creates a localized description of this exception.
-     * Subclasses may override this method in order to produce a
-     * locale-specific message. For subclasses that do not override this
-     * method, the default implementation returns the same result as
-     * <code>getMessage()</code>.
-     *
-     * @return The localized description of this exception.
-     */
-    public String getLocalizedMessage() {
-        return getMessage();
-    }
-
-    /**
-     * Returns the cause of this exception or <code>null</code> if the
-     * cause is nonexistent or unknown. (The cause is the throwable that
-     * caused this exception to get thrown.)
-     *
-     * @return the cause of this exception or <code>null</code> if the
-     *         cause is nonexistent or unknown.
-     */
-    public Throwable getCause() {
-        return rootCause;
+        super(rootCause);
     }
 
-    /**
-     * Prints this <code>RepositoryException</code> and its backtrace to the
-     * standard error stream.
-     */
-    public void printStackTrace() {
-        printStackTrace(System.err);
-    }
-
-    /**
-     * Prints this <code>RepositoryException</code> and its backtrace to the
-     * specified print stream.
-     *
-     * @param s <code>PrintStream</code> to use for output
-     */
-    public void printStackTrace(PrintStream s) {
-        synchronized (s) {
-            super.printStackTrace(s);
-            if (rootCause != null) {
-                rootCause.printStackTrace(s);
-            }
-        }
-    }
-
-    /**
-     * Prints this <code>RepositoryException</code> and its backtrace to
-     * the specified print writer.
-     *
-     * @param s <code>PrintWriter</code> to use for output
-     */
-    public void printStackTrace(PrintWriter s) {
-        synchronized (s) {
-            super.printStackTrace(s);
-            if (rootCause != null) {
-                rootCause.printStackTrace(s);
-            }
-        }
-    }
 }



Mime
View raw message