Buggy code:
public class RemotingHttpUpgradeService implements Service < RemotingHttpUpgradeService > { public static final String JBOSS_REMOTING = "jboss-remoting" ; public static final String MAGIC_NUMBER = "CF70DEB8-70F9-4FBA-8B4F-DFC3E723B4CD" ; public static final String SEC_JBOSS_REMOTING_KEY = "Sec-JbossRemoting-Key" ; public static final String SEC_JBOSS_REMOTING_ACCEPT = "Sec-JbossRemoting-Accept" ; public static final ServiceName HTTP_UPGRADE_REGISTRY = JBOSS . append ( "http-upgrade-registry" ) ; public static final ServiceName UPGRADE_SERVICE_NAME = JBOSS . append ( "remoting<seq2seq4repair_space>" , "remoting-http-upgrade-service" ) ; private final String httpConnectorName ; private final String endpointName ; private final InjectedValue < ChannelUpgradeHandler > injectedRegistry = new InjectedValue ( ) ; private final InjectedValue < ListenerRegistry > listenerRegistry = new InjectedValue ( ) ; private final InjectedValue < Endpoint > injectedEndpoint = new InjectedValue ( ) ; private final InjectedValue < RemotingSecurityProvider > securityProviderValue = new InjectedValue ( ) ; private final OptionMap connectorPropertiesOptionMap ; private HttpUpgradeMetadata httpUpgradeMetadata ; public RemotingHttpUpgradeService ( final String httpConnectorName , final String endpointName , final OptionMap connectorPropertiesOptionMap ) { } public static void installServices ( final ServiceTarget serviceTarget , final String remotingConnectorName , final String httpConnectorName , final ServiceName endpointName , final OptionMap connectorPropertiesOptionMap , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) { } @ Override public synchronized void start ( final StartContext context ) throws StartException { final Endpoint endpoint = injectedEndpoint . getValue ( ) ; RemotingSecurityProvider rsp = securityProviderValue . getValue ( ) ; ServerAuthenticationProvider sap = rsp . getServerAuthenticationProvider ( ) ; OptionMap . Builder builder = OptionMap . builder ( ) ; builder . addAll ( rsp . getOptionMap ( ) ) ; ListenerRegistry . Listener listenerInfo = listenerRegistry . getValue ( ) . getListener ( httpConnectorName ) ; assert listenerInfo != null ; listenerInfo . addHttpUpgradeMetadata ( ( httpUpgradeMetadata = new ListenerRegistry . HttpUpgradeMetadata ( "jboss-remoting" , endpointName ) ) ) ; RemotingConnectorBindingInfoService . install ( context . getChildTarget ( ) , context . getController ( ) . getName ( ) . getSimpleName ( ) , ( ( SocketBinding ) ( listenerInfo . getContextInformation ( "socket-binding" ) ) ) , ( listenerInfo . getProtocol ( ) . equals ( "https" ) ? "https-remoting" : "http-remoting" ) ) ; if ( ( connectorPropertiesOptionMap ) != null ) { builder . addAll ( connectorPropertiesOptionMap ) ; } OptionMap resultingMap = builder . getMap ( ) ; try { final ExternalConnectionProvider provider = endpoint . getConnectionProviderInterface ( HTTP_REMOTING . toString ( ) , ExternalConnectionProvider . class ) ; final ExternalConnectionProvider . ConnectionAdaptor adaptor = provider . createConnectionAdaptor ( resultingMap , sap ) ; injectedRegistry . getValue ( ) . addProtocol ( RemotingHttpUpgradeService . JBOSS_REMOTING , new org . xnio . ChannelListener < StreamConnection > ( ) { @ Override public void handleEvent ( final StreamConnection channel ) { if ( channel instanceof SslConnection ) { adaptor . adapt ( new org . xnio . channels . AssembledConnectedSslStreamChannel ( ( ( SslConnection ) ( channel ) ) , channel . getSourceChannel ( ) , channel . getSinkChannel ( ) ) ) ; } else { adaptor . adapt ( new org . xnio . channels . AssembledConnectedStreamChannel ( channel , channel . getSourceChannel ( ) , channel . getSinkChannel ( ) ) ) ; } } <START_BUG> } , new SimpleHttpUpgradeHandshake ( RemotingHttpUpgradeService . MAGIC_NUMBER , RemotingHttpUpgradeService . SEC_JBOSS_REMOTING_KEY , RemotingHttpUpgradeService . SEC_JBOSS_REMOTING_ACCEPT ) ) ; <END_BUG> } catch ( UnknownURISchemeException e ) { throw new StartException ( e ) ; } catch ( IOException e ) { throw new StartException ( e ) ; } } @ Override public synchronized void stop ( final StopContext context ) { } @ Override public synchronized RemotingHttpUpgradeService getValue ( ) throws IllegalArgumentException , IllegalStateException { } }

Fix:
} , HandshakeUtil . createHttpUpgradeHandshake ( RemotingHttpUpgradeService . MAGIC_NUMBER , RemotingHttpUpgradeService . SEC_JBOSS_REMOTING_KEY , RemotingHttpUpgradeService . SEC_JBOSS_REMOTING_ACCEPT ) ) ;