commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joerg Schaible (JIRA)" <j...@apache.org>
Subject [jira] Commented: (NET-208) TelnetInputStream swallows interruptedexception as IOException
Date Wed, 26 Mar 2008 09:51:24 GMT

    [ https://issues.apache.org/jira/browse/NET-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582212#action_12582212
] 

Joerg Schaible commented on NET-208:
------------------------------------

Maybe it is a better choice to throw an java.io.InterruptedIOException instead. Such an exception
may be thrown anyway (depending on the platform in use).

> TelnetInputStream swallows interruptedexception as IOException
> --------------------------------------------------------------
>
>                 Key: NET-208
>                 URL: https://issues.apache.org/jira/browse/NET-208
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Jan Van Besien
>
> The TelnetInputStream catches InterruptedException in the read() method (line 342) and
throws a new IOException without wrapping the InterruptedException. This means that the fact
that the read() method was interrupted can hardly be distinguished from any other IOException.
> I use thread interruption as a cancellation mechanism for a thread that uses the TelnetInputStream
to read data.
> The read method is not allowed to throw InterruptedException, so I propose to fix it
by at least wrapping the underlying InterruptedException:
> catch (InterruptedException e)
> {
>     throw new IOException("Fatal thread interruption during read.", e);
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message