Skip to content

Apache Lucene open-source search software

don't suppress CMS exception details

Michael McCandless5189558edb40
diff --git a/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java b/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java
index a3c045dec73..1ab00626dce 100644
--- a/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java
+++ b/lucene/src/test/org/apache/lucene/util/LuceneTestCaseJ4.java
@@ -193,6 +193,16 @@ public class LuceneTestCaseJ4 {
public void tearDown() throws Exception {
BooleanQuery.setMaxClauseCount(savedBoolMaxClauseCount);
try {
+
+ if (!uncaughtExceptions.isEmpty()) {
+ System.err.println("The following exceptions were thrown by threads:");
+ for (UncaughtExceptionEntry entry : uncaughtExceptions) {
+ System.err.println("*** Thread: " + entry.thread.getName() + " ***");
+ entry.exception.printStackTrace(System.err);
+ }
+ fail("Some threads threw uncaught exceptions!");
+ }
+
// calling assertSaneFieldCaches here isn't as useful as having test
// classes call it directly from the scope where the index readers
// are used, because they could be gc'ed just before this tearDown
@@ -218,14 +228,6 @@ public class LuceneTestCaseJ4 {
}
Thread.setDefaultUncaughtExceptionHandler(savedUncaughtExceptionHandler);
- if (!uncaughtExceptions.isEmpty()) {
- System.err.println("The following exceptions were thrown by threads:");
- for (UncaughtExceptionEntry entry : uncaughtExceptions) {
- System.err.println("*** Thread: " + entry.thread.getName() + " ***");
- entry.exception.printStackTrace(System.err);
- }
- fail("Some threads throwed uncaught exceptions!");
- }
}
/**