maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1098361 - /maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
Date Sun, 01 May 2011 15:48:51 GMT
Author: krosenvold
Date: Sun May  1 15:48:51 2011
New Revision: 1098361

URL: http://svn.apache.org/viewvc?rev=1098361&view=rev
Log:
o Let's see if this fixes the asf build

And yes, as usual this stuff doesn't fail locally. Even with the same options ;)

Modified:
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java?rev=1098361&r1=1098360&r2=1098361&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/util/NestedRuntimeException.java
Sun May  1 15:48:51 2011
@@ -106,6 +106,7 @@ public class NestedRuntimeException
      * <p>Note that this will only check one level of nesting.
      * Use <code>getRootCause()</code> to retrieve the innermost cause.
      *
+     * @see #getRootCause()
      */
     public Throwable getCause()
     {
@@ -170,6 +171,26 @@ public class NestedRuntimeException
     }
 
     /**
+     * Retrieve the innermost cause of this exception, if any.
+     * <p>Currently just traverses NestedRuntimeException causes. Will use
+     * the JDK 1.4 exception cause mechanism once Spring requires JDK 1.4.
+     *
+     * @return the innermost exception, or <code>null</code> if none
+     */
+    public Throwable getRootCause()
+    {
+        Throwable cause = getCause();
+        if ( cause instanceof NestedRuntimeException )
+        {
+            return ( (NestedRuntimeException) cause ).getRootCause();
+        }
+        else
+        {
+            return cause;
+        }
+    }
+
+    /**
      * Check whether this exception contains an exception of the given class:
      * either it is of the given class itself or it contains a nested cause
      * of the given class.



Mime
View raw message