jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r161955 - incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BaseException.java
Date Tue, 19 Apr 2005 19:42:45 GMT
Author: jukka
Date: Tue Apr 19 12:42:44 2005
New Revision: 161955

URL: http://svn.apache.org/viewcvs?view=rev&rev=161955
Log:
JCR-97: Improved Checkstyle conformance by making the BaseException.rootCause property private
(and final) and by removing an inline conditional.

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

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BaseException.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BaseException.java?view=diff&r1=161954&r2=161955
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BaseException.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BaseException.java Tue
Apr 19 12:42:44 2005
@@ -25,10 +25,11 @@
  * are not derived from <code>javax.jcr.RepositoryException</code>.
  */
 public abstract class BaseException extends Exception {
+
     /**
      * Root failure cause
      */
-    protected Throwable rootCause;
+    private final Throwable rootCause;
 
     /**
      * Constructs a new instance of this class with <code>null</code> as its
@@ -36,6 +37,7 @@
      */
     public BaseException() {
         super();
+        rootCause = null;
     }
 
     /**
@@ -47,6 +49,7 @@
      */
     public BaseException(String message) {
         super(message);
+        rootCause = null;
     }
 
     /**
@@ -82,9 +85,10 @@
         String s = super.getMessage();
         if (rootCause == null) {
             return s;
+        } else if (s == null) {
+            return rootCause.getMessage();
         } else {
-            String s2 = rootCause.getMessage();
-            return s == null ? s2 : s + ": " + s2;
+            return s + ": " + rootCause.getMessage();
         }
     }
 



Mime
View raw message