Buggy code:
public class VersionOneProtocolChannelReceiver implements Listener < String , List < ClientMapping > > , DeploymentRepositoryListener , Channel . Receiver { private static final byte HEADER_SESSION_OPEN_REQUEST = 1 ; private static final byte HEADER_INVOCATION_REQUEST = 3 ; private static final byte HEADER_INVOCATION_CANCELLATION_REQUEST = 4 ; private static final byte HEADER_TX_COMMIT_REQUEST = 15 ; private static final byte HEADER_TX_ROLLBACK_REQUEST = 16 ; private static final byte HEADER_TX_PREPARE_REQUEST = 17 ; private static final byte HEADER_TX_FORGET_REQUEST = 18 ; private static final byte HEADER_TX_BEFORE_COMPLETION_REQUEST = 19 ; private final ChannelAssociation channelAssociation ; private final DeploymentRepository deploymentRepository ; private final EJBRemoteTransactionsRepository transactionsRepository ; private final MarshallerFactory marshallerFactory ; private final ExecutorService executorService ; private final RegistryCollector < String , List < ClientMapping > > clientMappingRegistryCollector ; private final Set < VersionOneProtocolChannelReceiver . ClusterTopologyUpdateListener > clusterTopologyUpdateListeners = Collections . synchronizedSet ( new HashSet < VersionOneProtocolChannelReceiver . ClusterTopologyUpdateListener > ( ) ) ; private final RemoteAsyncInvocationCancelStatusService remoteAsyncInvocationCancelStatus ; public VersionOneProtocolChannelReceiver ( final ChannelAssociation channelAssociation , final DeploymentRepository deploymentRepository , final EJBRemoteTransactionsRepository transactionsRepository , final RegistryCollector < String , List < ClientMapping > > clientMappingRegistryCollector , final MarshallerFactory marshallerFactory , final ExecutorService executorService , final RemoteAsyncInvocationCancelStatusService asyncInvocationCancelStatusService ) { } public void startReceiving ( ) { } @ Override public void handleError ( Channel channel , IOException error ) { } @ Override public void handleEnd ( Channel channel ) { } @ Override public void handleMessage ( Channel channel , MessageInputStream messageInputStream ) { try { final int header = messageInputStream . read ( ) ; if ( ROOT_LOGGER . isTraceEnabled ( ) ) { ROOT_LOGGER . trace ( ( ( ( "Got<seq2seq4repair_space>message<seq2seq4repair_space>with<seq2seq4repair_space>header<seq2seq4repair_space>0x" + ( Integer . toHexString ( header ) ) ) + "<seq2seq4repair_space>on<seq2seq4repair_space>channel<seq2seq4repair_space>" ) + channel ) ) ; } MessageHandler messageHandler = null ; switch ( header ) { case VersionOneProtocolChannelReceiver . HEADER_INVOCATION_REQUEST : messageHandler = new MethodInvocationMessageHandler ( this . deploymentRepository , this . marshallerFactory , this . executorService , this . remoteAsyncInvocationCancelStatus ) ; break ; case VersionOneProtocolChannelReceiver . HEADER_INVOCATION_CANCELLATION_REQUEST : messageHandler = new InvocationCancellationMessageHandler ( this . remoteAsyncInvocationCancelStatus ) ; break ; case VersionOneProtocolChannelReceiver . HEADER_SESSION_OPEN_REQUEST : messageHandler = new SessionOpenRequestHandler ( this . deploymentRepository , this . marshallerFactory , this . executorService ) ; break ; case VersionOneProtocolChannelReceiver . HEADER_TX_COMMIT_REQUEST : messageHandler = new TransactionRequestHandler ( this . transactionsRepository , this . marshallerFactory , this . executorService , TransactionRequestType . COMMIT ) ; break ; case VersionOneProtocolChannelReceiver . HEADER_TX_ROLLBACK_REQUEST : messageHandler = new TransactionRequestHandler ( this . transactionsRepository , this . marshallerFactory , this . executorService , TransactionRequestType . ROLLBACK ) ; break ; case VersionOneProtocolChannelReceiver . HEADER_TX_FORGET_REQUEST : messageHandler = new TransactionRequestHandler ( this . transactionsRepository , this . marshallerFactory , this . executorService , TransactionRequestType . FORGET ) ; break ; case VersionOneProtocolChannelReceiver . HEADER_TX_PREPARE_REQUEST : messageHandler = new TransactionRequestHandler ( this . transactionsRepository , this . marshallerFactory , this . executorService , TransactionRequestType . PREPARE ) ; break ; case VersionOneProtocolChannelReceiver . HEADER_TX_BEFORE_COMPLETION_REQUEST : messageHandler = new TransactionRequestHandler ( this . transactionsRepository , this . marshallerFactory , this . executorService , TransactionRequestType . BEFORE_COMPLETION ) ; break ; default : ROOT_LOGGER . unsupportedMessageHeader ( Integer . toHexString ( header ) , channel ) ; return ; } messageHandler . processMessage ( channelAssociation , messageInputStream ) ; channel . receiveMessage ( this ) ; <START_BUG> } catch ( IOException e ) { <END_BUG> ROOT_LOGGER . exceptionOnChannel ( e , channel , messageInputStream ) ; IoUtils . safeClose ( channel ) ; } finally { IoUtils . safeClose ( messageInputStream ) ; } } @ Override public void listenerAdded ( DeploymentRepository repository ) { } @ Override public void deploymentAvailable ( DeploymentModuleIdentifier deploymentModuleIdentifier , ModuleDeployment moduleDeployment ) { } @ Override public void deploymentRemoved ( DeploymentModuleIdentifier deploymentModuleIdentifier ) { } private void sendModuleAvailability ( DeploymentModuleIdentifier [ ] availableModules ) throws IOException { } private void sendModuleUnAvailability ( DeploymentModuleIdentifier [ ] availableModules ) throws IOException { } @ Override public void registryAdded ( Registry < String , List < ClientMapping > > cluster ) { } @ Override public void registryRemoved ( Registry < String , List < ClientMapping > > registry ) { } private void sendNewClusterFormedMessage ( final Collection < Registry < String , List < ClientMapping > > > clientMappingRegistries ) throws IOException { } private void sendClusterRemovedMessage ( final Registry < String , List < ClientMapping > > registry ) throws IOException { } private void cleanupOnChannelDown ( ) { } private class ChannelCloseHandler implements CloseHandler < Channel > { @ Override public void handleClose ( Channel closedChannel , IOException exception ) { } } private class ClusterTopologyUpdateListener implements Registry . Listener < String , List < ClientMapping > > { private final String clusterName ; private final VersionOneProtocolChannelReceiver channelReceiver ; private final Registry < String , List < ClientMapping > > cluster ; ClusterTopologyUpdateListener ( Registry < String , List < ClientMapping > > cluster , final VersionOneProtocolChannelReceiver channelReceiver ) { } @ Override public void addedEntries ( Map < String , List < ClientMapping > > added ) { } @ Override public void updatedEntries ( Map < String , List < ClientMapping > > updated ) { } @ Override public void removedEntries ( Set < String > removed ) { } private void unregisterListener ( ) { } private void sendClusterNodesRemoved ( final Set < String > removedNodes ) throws IOException { } private void sendClusterNodesAdded ( final Map < String , List < ClientMapping > > addedNodes ) throws IOException { } } }

Fix:
} catch ( Throwable e ) {