Issue Details (XML | Word | Printable)

Key: NET-208
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Jan Van Besien
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

TelnetInputStream swallows interruptedexception as IOException

Created: 26/Mar/08 09:14 AM   Updated: 16/May/08 11:19 PM
Return to search
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 2.0, 1.5

Time Tracking:
Not Specified

Resolution Date: 16/May/08 09:35 PM


 Description  « Hide
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);
}



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Rory Winston made changes - 16/May/08 09:18 AM
Field Original Value New Value
Fix Version/s 2.0 [ 12312040 ]
Rory Winston made changes - 16/May/08 08:53 PM
Fix Version/s 1.5 [ 12312041 ]
Rory Winston made changes - 16/May/08 09:35 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]