You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by mi...@apache.org on 2009/11/14 12:31:06 UTC
svn commit: r836156 -
/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
Author: mikemccand
Date: Sat Nov 14 11:31:05 2009
New Revision: 836156
URL: http://svn.apache.org/viewvc?rev=836156&view=rev
Log:
LUCENE-2053: throw ThreadInterruptedException when the thread is interrupt()d
Modified:
lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=836156&r1=836155&r2=836156&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java Sat Nov 14 11:31:05 2009
@@ -4366,16 +4366,11 @@
}
} catch (RuntimeException re) {
Throwable e = re.getCause();
- if (e instanceof InterruptedException) {
- // Make sure IW restored interrupted bit
- if (!interrupted()) {
- System.out.println("FAILED; InterruptedException hit but thread.interrupted() was false");
- e.printStackTrace(System.out);
- failed = true;
- break;
- }
- } else {
- System.out.println("FAILED; unexpected exception");
+ assertTrue(e instanceof InterruptedException);
+
+ // Make sure IW cleared the interrupted bit
+ if (interrupted()) {
+ System.out.println("FAILED; InterruptedException hit but thread.interrupted() was true");
e.printStackTrace(System.out);
failed = true;
break;