You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2022/02/03 02:27:23 UTC
[maven-surefire] branch master updated: [SUREFIRE-1997] InterruptedIOException and cause:InterruptedException have the same purpose and should be caught in CommandReader
This is an automated email from the ASF dual-hosted git repository.
tibordigana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
The following commit(s) were added to refs/heads/master by this push:
new 9b44095 [SUREFIRE-1997] InterruptedIOException and cause:InterruptedException have the same purpose and should be caught in CommandReader
9b44095 is described below
commit 9b44095a7167842bcea2c8c78e0a6d58653a96f6
Author: Tibor Digaňa <ti...@apache.org>
AuthorDate: Tue Feb 1 14:33:19 2022 +0100
[SUREFIRE-1997] InterruptedIOException and cause:InterruptedException have the same purpose and should be caught in CommandReader
---
.../main/java/org/apache/maven/surefire/booter/CommandReader.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/CommandReader.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
index 5509095..609327c 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
@@ -33,6 +33,7 @@ import org.apache.maven.surefire.api.testset.TestSetFailedException;
import java.io.EOFException;
import java.io.IOException;
+import java.io.InterruptedIOException;
import java.nio.channels.ClosedChannelException;
import java.util.Iterator;
import java.util.NoSuchElementException;
@@ -393,8 +394,9 @@ public final class CommandReader implements CommandChainReader
catch ( IOException e )
{
CommandReader.this.state.set( TERMINATED );
- // If #stop() method is called, reader thread is interrupted and cause is InterruptedException.
- if ( !( e.getCause() instanceof InterruptedException ) )
+ // If #stop() method is called, reader thread is interrupted
+ // and exception is InterruptedIOException or its cause is InterruptedException.
+ if ( !( e instanceof InterruptedIOException || e.getCause() instanceof InterruptedException ) )
{
String msg = "[SUREFIRE] std/in stream corrupted";
DumpErrorSingleton.getSingleton().dumpStreamException( e, msg );