Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authorbvosburgh2009-10-08 19:10:41 +0000
committerbvosburgh2009-10-08 19:10:41 +0000
commita7f4cb63e531920f005097826eaeb90db8026037 (patch)
treeec2c1189a906ecfe9e64a60a05fa9edbefca87a3 /jpa
parentd2aa7cb47ed229aa124ace66add8a91e67804978 (diff)
downloadwebtools.dali-a7f4cb63e531920f005097826eaeb90db8026037.tar.gz
webtools.dali-a7f4cb63e531920f005097826eaeb90db8026037.tar.xz
webtools.dali-a7f4cb63e531920f005097826eaeb90db8026037.zip
log composite exception a bit better
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeException.java9
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java12
2 files changed, 11 insertions, 10 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeException.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeException.java
index 69d5f89166..95161e2da9 100644
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeException.java
+++ b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeException.java
@@ -9,14 +9,21 @@
******************************************************************************/
package org.eclipse.jpt.utility.internal;
+/**
+ * Provide a way for multiple exceptions to be packaged and reported.
+ */
public class CompositeException
extends RuntimeException
{
private final Throwable[] exceptions;
private static final long serialVersionUID = 1L;
+ /**
+ * The specified exceptions list must not be empty.
+ */
public CompositeException(Throwable[] exceptions) {
- super();
+ // grab the first exception and make it the "cause"
+ super(exceptions[0]);
this.exceptions = exceptions;
}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java
index ad9bac8328..054bf08452 100644
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java
+++ b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java
@@ -447,24 +447,18 @@ public class SynchronousSynchronizerTests extends TestCase {
// ignore
}
- try {
- synchronizer.synchronize();
- } catch (NullPointerException ex) {
- // ignore
- }
-
boolean exCaught = false;
try {
// we used to hang here, before we began handling exceptions
synchronizer.stop();
fail();
} catch (CompositeException ex) {
- assertEquals(2, ex.getExceptions().length);
+ assertEquals(1, ex.getExceptions().length);
exCaught = true;
}
assertTrue(exCaught);
- // start + 2 synchronizes
- assertEquals(3, command.count);
+ // start + synchronize
+ assertEquals(2, command.count);
}
public class BogusCommand implements Command {

Back to the top