Buggy code:
public class EJBRemoteConnectorService implements Service < EJBRemoteConnectorService > { private static final Logger log = Logger . getLogger ( EJBRemoteConnectorService . class ) ; private static final String EJB_CHANNEL_NAME = "jboss.ejb" ; public static final ServiceName SERVICE_NAME = JBOSS . append ( "ejb3" , "connector" ) ; private final InjectedValue < Endpoint > endpointValue = new InjectedValue < Endpoint > ( ) ; private volatile Registration registration ; private final byte serverProtocolVersion ; private final String [ ] supportedMarshallingStrategies ; public EJBRemoteConnectorService ( final byte serverProtocolVersion , final String [ ] supportedMarshallingStrategies ) { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public EJBRemoteConnectorService getValue ( ) throws IllegalArgumentException , IllegalStateException { } public InjectedValue < Endpoint > getEndpointInjector ( ) { } private void sendVersionMessage ( final Channel channel ) throws IOException { } private class ChannelOpenListener implements OpenListener { private final ServiceContainer serviceContainer ; ChannelOpenListener ( final ServiceContainer serviceContainer ) { } @ Override public void channelOpened ( Channel channel ) { } @ Override public void registrationTerminated ( ) { } } private class ClientVersionMessageReceiver implements Channel . Receiver { private final ServiceContainer serviceContainer ; ClientVersionMessageReceiver ( final ServiceContainer serviceContainer ) { } @ Override public void handleError ( Channel channel , IOException error ) { } @ Override public void handleEnd ( Channel channel ) { } @ Override public void handleMessage ( Channel channel , MessageInputStream messageInputStream ) { final DataInputStream dataInputStream = new DataInputStream ( messageInputStream ) ; try { final byte version = dataInputStream . readByte ( ) ; final String clientMarshallingStrategy = dataInputStream . readUTF ( ) ; EJBRemoteConnectorService . log . debug ( ( ( ( ( ( "Client<seq2seq4repair_space>with<seq2seq4repair_space>protocol<seq2seq4repair_space>version<seq2seq4repair_space>" + version ) + "<seq2seq4repair_space>and<seq2seq4repair_space>marshalling<seq2seq4repair_space>strategy<seq2seq4repair_space>" ) + clientMarshallingStrategy ) + "<seq2seq4repair_space>will<seq2seq4repair_space>communicate<seq2seq4repair_space>on<seq2seq4repair_space>" ) + channel ) ) ; switch ( version ) { <START_BUG> case 0 : <END_BUG> final VersionOneProtocolChannelReceiver receiver = new VersionOneProtocolChannelReceiver ( channel , this . serviceContainer , clientMarshallingStrategy ) ; receiver . startReceiving ( ) ; break ; default : throw new RuntimeException ( ( "Cannot<seq2seq4repair_space>handle<seq2seq4repair_space>client<seq2seq4repair_space>version<seq2seq4repair_space>" + version ) ) ; } } catch ( IOException e ) { EJBRemoteConnectorService . log . errorf ( e , "Exception<seq2seq4repair_space>on<seq2seq4repair_space>channel<seq2seq4repair_space>%s<seq2seq4repair_space>from<seq2seq4repair_space>message<seq2seq4repair_space>%s" , channel , messageInputStream ) ; IoUtils . safeClose ( channel ) ; } finally { IoUtils . safeClose ( messageInputStream ) ; } } } }

Fix:
case 1 :