Buggy code:
public class OperationCoordinatorStepHandler { private final LocalHostControllerInfo localHostControllerInfo ; private final ContentRepository contentRepository ; private final Map < String , ProxyController > hostProxies ; private final Map < String , ProxyController > serverProxies ; private final OperationSlaveStepHandler localSlaveHandler ; private volatile ExecutorService executorService ; OperationCoordinatorStepHandler ( final LocalHostControllerInfo localHostControllerInfo , ContentRepository contentRepository , final Map < String , ProxyController > hostProxies , final Map < String , ProxyController > serverProxies , final OperationSlaveStepHandler localSlaveHandler ) { } void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } public void setExecutorService ( ExecutorService executorService ) { } private ExecutorService getExecutorService ( ) { } private void routeToMasterDomainController ( OperationContext context , ModelNode operation ) { } private void executeDirect ( OperationContext context , ModelNode operation ) throws OperationFailedException { } private void executeTwoPhaseOperation ( OperationContext context , ModelNode operation , OperationRouting routing ) throws OperationFailedException { if ( DomainControllerLogger . HOST_CONTROLLER_LOGGER . isTraceEnabled ( ) ) { DomainControllerLogger . HOST_CONTROLLER_LOGGER . trace ( "Executing<seq2seq4repair_space>two-phase" ) ; } DomainOperationContext overallContext = new DomainOperationContext ( localHostControllerInfo ) ; ModelNode rolloutPlan = ( ( operation . hasDefined ( OPERATION_HEADERS ) ) && ( operation . get ( OPERATION_HEADERS ) . has ( ROLLOUT_PLAN ) ) ) ? operation . get ( OPERATION_HEADERS ) . remove ( ROLLOUT_PLAN ) : new ModelNode ( ) ; context . addStep ( new DomainFinalResultHandler ( overallContext ) , MODEL ) ; final ModelNode slaveOp = operation . clone ( ) ; storeDeploymentContent ( slaveOp , context ) ; slaveOp . get ( OPERATION_HEADERS , EXECUTE_FOR_COORDINATOR ) . set ( true ) ; slaveOp . protect ( ) ; String localHostName = localHostControllerInfo . getLocalHostName ( ) ; if ( routing . isLocalCallNeeded ( localHostName ) ) { ModelNode localResponse = overallContext . getCoordinatorResult ( ) ; localSlaveHandler . addSteps ( context , slaveOp . clone ( ) , localResponse , false ) ; } if ( localHostControllerInfo . isMasterDomainController ( ) ) { Set < String > remoteHosts = new HashSet < String > ( routing . getHosts ( ) ) ; boolean global = ( remoteHosts . size ( ) ) == 0 ; remoteHosts . remove ( localHostName ) ; if ( ( ( remoteHosts . size ( ) ) > 0 ) || global ) { context . acquireControllerLock ( ) ; if ( global ) { remoteHosts . addAll ( hostProxies . keySet ( ) ) ; } Map < String , ProxyController > remoteProxies = new HashMap < String , ProxyController > ( ) ; for ( String host : remoteHosts ) { ProxyController proxy = hostProxies . get ( host ) ; if ( proxy != null ) { remoteProxies . put ( host , proxy ) ; } else if ( ! global ) { throw DomainControllerMessages . MESSAGES . invalidOperationTargetHost ( host ) ; } } <START_BUG> context . addStep ( slaveOp . clone ( ) , new DomainSlaveHandler ( remoteProxies , overallContext , executorService ) , DOMAIN ) ; <END_BUG> } } context . addStep ( new DomainRolloutStepHandler ( hostProxies , serverProxies , overallContext , rolloutPlan , getExecutorService ( ) ) , DOMAIN ) ; context . completeStep ( ) ; } private void storeDeploymentContent ( ModelNode opNode , OperationContext context ) throws OperationFailedException { } private boolean hasStorableContent ( ModelNode operation ) { } private static final List < String > CONTENT_ADDITION_PARAMETERS = Arrays . asList ( INPUT_STREAM_INDEX , BYTES , URL ) ; private static boolean hasValidContentAdditionParameterDefined ( ModelNode item ) { } }

Fix:
context . addStep ( slaveOp . clone ( ) , new DomainSlaveHandler ( remoteProxies , overallContext ) , DOMAIN ) ;