Buggy code:
public class DeploymentFullReplaceHandler implements ModelUpdateOperationHandler , DescriptionProvider { public static final String OPERATION_NAME = "full-replace-deployment" ; static final ModelNode getOperation ( ModelNode address ) { } private final DeploymentRepository deploymentRepository ; private final ParametersValidator validator = new ParametersValidator ( ) ; public DeploymentFullReplaceHandler ( final DeploymentRepository deploymentRepository ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public OperationResult execute ( OperationContext context , ModelNode operation , ResultHandler resultHandler ) throws OperationFailedException { try { byte [ ] hash = null ; String failure = validator . validate ( operation ) ; if ( failure != null ) { throw new OperationFailedException ( new ModelNode ( ) . set ( failure ) ) ; } hash = operation . get ( HASH ) . asBytes ( ) ; if ( ! ( deploymentRepository . hasDeploymentContent ( hash ) ) ) { throw new OperationFailedException ( new ModelNode ( ) . set ( String . format ( "No<seq2seq4repair_space>deployment<seq2seq4repair_space>content<seq2seq4repair_space>with<seq2seq4repair_space>hash<seq2seq4repair_space>%s<seq2seq4repair_space>is<seq2seq4repair_space>available<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>deployment<seq2seq4repair_space>content<seq2seq4repair_space>repository." , HashUtil . bytesToHexString ( hash ) ) ) ) ; } ModelNode rootModel = context . getSubModel ( ) ; ModelNode deployments = rootModel . get ( DEPLOYMENT ) ; String name = operation . require ( NAME ) . asString ( ) ; ModelNode replaceNode = ( DeploymentFullReplaceHandler . has ( deployments , name ) ) ? deployments . get ( name ) : null ; if ( replaceNode == null ) { throw new OperationFailedException ( new ModelNode ( ) . set ( String . format ( "No<seq2seq4repair_space>deployment<seq2seq4repair_space>with<seq2seq4repair_space>name<seq2seq4repair_space>%s<seq2seq4repair_space>found" , name ) ) ) ; } boolean start = replaceNode . get ( START ) . asBoolean ( ) ; String runtimeName = ( DeploymentFullReplaceHandler . has ( operation , RUNTIME_NAME ) ) ? operation . get ( RUNTIME_NAME ) . asString ( ) : name ; ModelNode deployNode = new ModelNode ( ) ; deployNode . get ( NAME ) . set ( name ) ; deployNode . get ( RUNTIME_NAME ) . set ( runtimeName ) ; deployNode . get ( HASH ) . set ( hash ) ; deployNode . get ( START ) . set ( start ) ; deployments . get ( name ) . set ( deployNode ) ; ModelNode compensatingOp = operation . clone ( ) ; compensatingOp . get ( HASH ) . set ( replaceNode . get ( HASH ) ) ; compensatingOp . get ( START ) . set ( start ) ; if ( start ) { <START_BUG> DeploymentHandlerUtil . replace ( deployNode , name , context , resultHandler , compensatingOp ) ; <END_BUG> } else { resultHandler . handleResultComplete ( ) ; return new BasicOperationResult ( compensatingOp ) ; } } catch ( Exception e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( e . getLocalizedMessage ( ) ) ) ; } return new BasicOperationResult ( ) ; } private static boolean has ( ModelNode node , String child ) { } }

Fix:
DeploymentHandlerUtil . replace ( deployNode , name , context , resultHandler ) ;