Buggy code:
public class MasterDomainControllerOperationHandlerImpl extends AbstractModelControllerOperationHandler { private final ModelControllerClientOperationHandler clientHandler ; private volatile ManagementOperationHandler proxyHandler ; private final DomainController domainController ; private final UnregisteredHostChannelRegistry registry ; public MasterDomainControllerOperationHandlerImpl ( final ExecutorService executorService , final ModelController controller , final UnregisteredHostChannelRegistry registry , final DomainController domainController ) { } @ Override public ManagementRequestHandler getRequestHandler ( byte id ) { } private abstract class RegistryOperation extends ManagementRequestHandler { String hostId ; RegistryOperation ( ) { } @ Override protected void readRequest ( final DataInput input ) throws IOException { } } private class RegisterOperation extends MasterDomainControllerOperationHandlerImpl . RegistryOperation { String error ; @ Override protected void readRequest ( final DataInput input ) throws IOException { } @ Override protected void processRequest ( ) throws RequestProcessingException { try { registry . registerChannel ( hostId , getChannel ( ) , new ProxyCreatedCallback ( ) { @ Override public void proxyCreated ( ManagementOperationHandler handler ) { proxyHandler = handler ; } } ) ; ModelNode op = new ModelNode ( ) ; op . get ( OP ) . set ( OPERATION_NAME ) ; op . get ( OP_ADDR ) . setEmptyList ( ) ; op . get ( HOST ) . set ( hostId ) ; ModelNode result = controller . execute ( op , logging , COMMIT , null ) ; if ( result . hasDefined ( FAILURE_DESCRIPTION ) ) { error = result . get ( FAILURE_DESCRIPTION ) . asString ( ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; <START_BUG> error = e . getMessage ( ) ; <END_BUG> } } @ Override protected void writeResponse ( final FlushableDataOutput output ) throws IOException { } } private class UnregisterOperation extends MasterDomainControllerOperationHandlerImpl . RegistryOperation { @ Override protected void processRequest ( ) throws RequestProcessingException { domainController . unregisterRemoteHost ( hostId ) ; } } private class GetFileOperation extends MasterDomainControllerOperationHandlerImpl . RegistryOperation { private File localPath ; private byte rootId ; private String filePath ; @ Override protected void readRequest ( final DataInput input ) throws IOException { } @ Override protected void processRequest ( ) throws RequestProcessingException { final FileRepository localFileRepository = domainController . getLocalFileRepository ( ) ; switch ( rootId ) { case DomainControllerProtocol . PARAM_ROOT_ID_FILE : { localPath = localFileRepository . getFile ( filePath ) ; break ; } case DomainControllerProtocol . PARAM_ROOT_ID_CONFIGURATION : { localPath = localFileRepository . getConfigurationFile ( filePath ) ; break ; } case DomainControllerProtocol . PARAM_ROOT_ID_DEPLOYMENT : { byte [ ] hash = HashUtil . hexStringToByteArray ( filePath ) ; localPath = localFileRepository . getDeploymentRoot ( hash ) ; break ; } default : { throw new RequestProcessingException ( String . format ( "Invalid<seq2seq4repair_space>root<seq2seq4repair_space>id<seq2seq4repair_space>[%d]" , rootId ) ) ; } } } @ Override protected void writeResponse ( final FlushableDataOutput output ) throws IOException { } private List < File > getChildFiles ( final File base ) { } private void getChildFiles ( final File base , final List < File > childFiles ) { } private String getRelativePath ( final File parent , final File child ) { } private void writeFile ( final File file , final FlushableDataOutput output ) throws IOException { } } }

Fix:
error = SlaveRegistrationError . formatHostAlreadyExists ( e . getMessage ( ) ) ;