Buggy code:
public class ManagementClient { private static final String SUBDEPLOYMENT = "subdeployment" ; private static final String WEB = "web" ; private static final String JMX = "jmx" ; private static final String NAME = "name" ; private static final String SERVLET = "servlet" ; private static final String POSTFIX_WEB = ".war" ; private static final String POSTFIX_EAR = ".ear" ; private final String mgmtAddress ; private final ModelControllerClient client ; private final Map < String , URI > subsystemURICache ; private ModelNode rootNode = null ; private MBeanServerConnection connection ; private JMXConnector connector ; public ManagementClient ( ModelControllerClient client , final String mgmtAddress ) { } public ModelControllerClient getControllerClient ( ) { } public URI getSubSystemURI ( String subsystem ) { } public ProtocolMetaData getDeploymentMetaData ( String deploymentName ) { } public boolean isServerInRunningState ( ) { } public void close ( ) { } private URI extractSubSystemURI ( String subsystem ) { try { if ( ( rootNode ) == null ) { readRootNode ( ) ; } } catch ( Exception e ) { throw new RuntimeException ( e ) ; } if ( "web" . equals ( subsystem ) ) { String socketBinding = rootNode . get ( "subsystem" ) . get ( "web" ) . get ( "connector" ) . get ( "http" ) . get ( "socket-binding" ) . asString ( ) ; return getBinding ( socketBinding ) ; } else if ( "jmx" . equals ( subsystem ) ) { <START_BUG> String socketBinding = rootNode . get ( "subsystem" ) . get ( "jmx" ) . get ( "registry-binding" ) . asString ( ) ; <END_BUG> return getBinding ( socketBinding ) ; } throw new IllegalArgumentException ( ( "No<seq2seq4repair_space>handler<seq2seq4repair_space>for<seq2seq4repair_space>subsystem<seq2seq4repair_space>" + subsystem ) ) ; } private void readRootNode ( ) throws Exception { } private URI getBinding ( final String socketBinding ) { } private String getInterface ( final String name ) { } private boolean isEnterpriseArchive ( String deploymentName ) { } private boolean isWebArchive ( String deploymentName ) { } private ModelNode createDeploymentAddress ( String deploymentName ) { } private void extractEnterpriseArchiveContexts ( HTTPContext context , ModelNode deploymentNode ) { } private void extractWebArchiveContexts ( HTTPContext context , ModelNode deploymentNode ) { } private void extractWebArchiveContexts ( HTTPContext context , String deploymentName , ModelNode deploymentNode ) { } private String toContextName ( String deploymentName ) { } private ModelNode readResource ( ModelNode address ) throws Exception { } private ModelNode executeForResult ( final ModelNode operation ) throws Exception { } private void checkSuccessful ( final ModelNode result , final ModelNode operation ) throws ManagementClient . UnSuccessfulOperationException { } private static class UnSuccessfulOperationException extends Exception { private static final long serialVersionUID = 1L ; public UnSuccessfulOperationException ( String message ) { } } private MBeanServerConnection getConnection ( ) { } private JMXServiceURL getRemoteJMXURL ( ) { } }

Fix:
String socketBinding = rootNode . get ( "subsystem" ) . get ( "jmx" ) . get ( "connector" ) . get ( "jmx" ) . get ( "registry-binding" ) . asString ( ) ;