Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-208

TelnetInputStream swallows interruptedexception as IOException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5, 2.0
    • Component/s: None
    • Labels:
      None

      Description

      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);
      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jvb Jan Van Besien
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: