Removed unnecessary 'if' condition

This commit is contained in:
Trustin Lee 2009-02-09 09:13:45 +00:00
parent e757135583
commit 03de679b17

View File

@ -160,24 +160,22 @@ class LocalChannel extends AbstractChannel {
return;
}
if (pairedChannel == null || !isOpen()) {
// Channel is closed or not connected yet - notify as failures.
Exception cause;
if (isOpen()) {
cause = new NotYetConnectedException();
} else {
cause = new ClosedChannelException();
// Channel is closed or not connected yet - notify as failures.
Exception cause;
if (isOpen()) {
cause = new NotYetConnectedException();
} else {
cause = new ClosedChannelException();
}
for (;;) {
MessageEvent e = writeBuffer.poll();
if(e == null) {
break;
}
for (;;) {
MessageEvent e = writeBuffer.poll();
if(e == null) {
break;
}
e.getFuture().setFailure(cause);
fireExceptionCaught(this, cause);
}
e.getFuture().setFailure(cause);
fireExceptionCaught(this, cause);
}
}
}