Skip to content

Commit d66d0a9

Browse files
committed
Rethrow InterruptedIOException
1 parent 3506ba9 commit d66d0a9

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/main/java/ch/ethz/ssh2/transport/TransportManager.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void run()
9595
{
9696
while (true)
9797
{
98-
AsynchronousEntry item = null;
98+
AsynchronousEntry item;
9999

100100
synchronized (asynchronousQueue)
101101
{
@@ -463,7 +463,7 @@ private static Socket establishConnection(String hostname, int port, ProxyData p
463463
throw new IOException("The proxy did not send back a valid HTTP response.");
464464
}
465465

466-
int errorCode = 0;
466+
int errorCode;
467467

468468
try
469469
{
@@ -510,7 +510,7 @@ public void run()
510510
{
511511
receiveLoop();
512512
}
513-
catch (Exception e)
513+
catch (IOException e)
514514
{
515515
close(e, false);
516516

@@ -541,7 +541,7 @@ public void run()
541541
{
542542
he.mh.handleMessage(null, 0);
543543
}
544-
catch (Exception ignore)
544+
catch (IOException ignored)
545545
{
546546
}
547547
}
@@ -759,6 +759,7 @@ public void sendMessage(byte[] msg) throws IOException
759759
}
760760
catch (InterruptedException e)
761761
{
762+
throw new InterruptedIOException(e.getMessage());
762763
}
763764
}
764765
}
@@ -933,15 +934,12 @@ public void receiveLoop() throws IOException
933934

934935
MessageHandler mh = null;
935936

936-
for (int i = 0; i < messageHandlers.size(); i++)
937-
{
938-
HandlerEntry he = messageHandlers.get(i);
939-
if ((he.low <= type) && (type <= he.high))
940-
{
941-
mh = he.mh;
942-
break;
943-
}
944-
}
937+
for(HandlerEntry he : messageHandlers) {
938+
if((he.low <= type) && (type <= he.high)) {
939+
mh = he.mh;
940+
break;
941+
}
942+
}
945943

946944
if (mh == null)
947945
{

0 commit comments

Comments
 (0)