This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git


The following commit(s) were added to refs/heads/master by this push:
     new 841618aa TelnetInputStream.read() doesn't preserve the original 
InterruptedException as the cause of its InterruptedIOException.
841618aa is described below

commit 841618aae0e1759fd3e331f76c0ba4b60245b65c
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Feb 1 08:05:56 2026 -0500

    TelnetInputStream.read() doesn't preserve the original
    InterruptedException as the cause of its InterruptedIOException.
---
 src/changes/changes.xml                                            | 1 +
 src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 8295e194..7656472a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -70,6 +70,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary 
Gregory">IOUtil.readWrite() now restores the current thread's interrupt flag 
when catching InterruptedException.</action>
       <action type="fix" dev="ggregory" due-to="Gary 
Gregory">TelnetInputStream now restores the current thread's interrupt flag 
when catching InterruptedException.</action>
       <action type="fix" dev="ggregory" due-to="Jianwei Guo, Gary Gregory" 
issue="NET-740">FTP fails to parse listings for Linux vsftpd in Chinese or 
Japanese #393.</action>
+      <action type="fix" dev="ggregory" due-to="Gary 
Gregory">TelnetInputStream.read() doesn't preserve the original 
InterruptedException as the cause of its InterruptedIOException.</action>
       <!-- ADD -->
       <action type="add" dev="ggregory" due-to="Gary Gregory">Add 
DatagramSocketClient.getDefaultTimeoutDuration() and deprecate 
getDefaultTimeout().</action> 
       <!-- UPDATE -->
diff --git a/src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java 
b/src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java
index 755b740e..5953d810 100644
--- a/src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java
+++ b/src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java
@@ -199,7 +199,9 @@ final class TelnetInputStream extends BufferedInputStream 
implements Runnable {
                             readIsWaiting = false;
                         } catch (final InterruptedException e) {
                             Thread.currentThread().interrupt();
-                            throw new InterruptedIOException("Fatal thread 
interruption during read.");
+                            final InterruptedIOException 
interruptedIoException = new InterruptedIOException("Fatal thread interruption 
during read.");
+                            interruptedIoException.initCause(e);
+                            throw interruptedIoException;
                         }
                     } else {
                         // alreadyread = false;

Reply via email to