Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2015-07-22 23:02:52 +0000
committerGreg Wilkins2015-07-22 23:02:52 +0000
commit30a99ddcf403e0dc20e2d723b6cc71359691c517 (patch)
tree01fde747bdec3a51d8996ddd945878faca7eaabb
parentbcc976312d6c097b8f789bf5d2fc1ebe66cb602c (diff)
downloadorg.eclipse.jetty.project-30a99ddcf403e0dc20e2d723b6cc71359691c517.tar.gz
org.eclipse.jetty.project-30a99ddcf403e0dc20e2d723b6cc71359691c517.tar.xz
org.eclipse.jetty.project-30a99ddcf403e0dc20e2d723b6cc71359691c517.zip
473266 - init MultiException cause
-rw-r--r--jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java3
-rw-r--r--jetty-util/src/test/java/org/eclipse/jetty/util/MultiExceptionTest.java13
2 files changed, 16 insertions, 0 deletions
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java
index fdc62c516c..5dd913feb2 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java
@@ -47,7 +47,10 @@ public class MultiException extends Exception
throw new IllegalArgumentException();
if(nested == null)
+ {
+ initCause(e);
nested = new ArrayList<>();
+ }
if (e instanceof MultiException)
{
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/MultiExceptionTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/MultiExceptionTest.java
index 20cdef6e9e..1c60293ff9 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/MultiExceptionTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/MultiExceptionTest.java
@@ -148,4 +148,17 @@ public class MultiExceptionTest
assertTrue(e.getCause()==me);
}
}
+
+ @Test
+ public void testCause() throws Exception
+ {
+ MultiException me = new MultiException();
+ IOException io = new IOException("one");
+ RuntimeException run = new RuntimeException("two");
+ me.add(io);
+ me.add(run);
+
+ assertEquals(2,me.size());
+ assertEquals(io,me.getCause());
+ }
}

Back to the top