Buggy code:
public abstract class AbstractServerDeploymentManager implements ServerDeploymentManager { protected AbstractServerDeploymentManager ( ) { } @ Override public InitialDeploymentPlanBuilder newDeploymentPlan ( ) { } @ Override public Future < ServerDeploymentPlanResult > execute ( DeploymentPlan plan ) { } protected abstract Future < ModelNode > executeOperation ( Operation context ) { } private Operation getCompositeOperation ( DeploymentPlanImpl plan ) { ModelNode op = new ModelNode ( ) ; op . get ( ClientConstants . OP ) . set ( ClientConstants . COMPOSITE ) ; op . get ( ClientConstants . OP_ADDR ) . setEmptyList ( ) ; ModelNode steps = op . get ( ClientConstants . STEPS ) ; steps . setEmptyList ( ) ; op . get ( ClientConstants . OPERATION_HEADERS , ClientConstants . ROLLBACK_ON_RUNTIME_FAILURE ) . set ( plan . isGlobalRollback ( ) ) ; OperationBuilder builder = Factory . create ( op ) ; int stream = 0 ; for ( DeploymentActionImpl action : plan . getDeploymentActionImpls ( ) ) { ModelNode step = new ModelNode ( ) ; String uniqueName = action . getDeploymentUnitUniqueName ( ) ; switch ( action . getType ( ) ) { case ClientConstants . ADD : { configureDeploymentOperation ( step , ClientConstants . ADD , uniqueName ) ; step . get ( ClientConstants . RUNTIME_NAME ) . set ( action . getNewContentFileName ( ) ) ; builder . addInputStream ( action . getContentStream ( ) ) ; step . get ( ClientConstants . CONTENT ) . get ( 0 ) . get ( ClientConstants . INPUT_STREAM_INDEX ) . set ( ( stream ++ ) ) ; break ; } case DEPLOY : { configureDeploymentOperation ( step , ClientConstants . DEPLOYMENT_DEPLOY_OPERATION , uniqueName ) ; break ; } case FULL_REPLACE : { step . get ( ClientConstants . OP ) . set ( ClientConstants . DEPLOYMENT_FULL_REPLACE_OPERATION ) ; step . get ( ClientConstants . OP_ADDR ) . setEmptyList ( ) ; step . get ( ClientConstants . NAME ) . set ( uniqueName ) ; step . get ( ClientConstants . RUNTIME_NAME ) . set ( action . getNewContentFileName ( ) ) ; builder . addInputStream ( action . getContentStream ( ) ) ; <START_BUG> step . get ( ClientConstants . INPUT_STREAM_INDEX ) . set ( ( stream ++ ) ) ; <END_BUG> break ; } case REDEPLOY : { configureDeploymentOperation ( step , ClientConstants . DEPLOYMENT_REDEPLOY_OPERATION , uniqueName ) ; break ; } case REMOVE : { configureDeploymentOperation ( step , ClientConstants . DEPLOYMENT_REMOVE_OPERATION , uniqueName ) ; break ; } case REPLACE : { step . get ( ClientConstants . OP ) . set ( ClientConstants . DEPLOYMENT_REPLACE_OPERATION ) ; step . get ( ClientConstants . OP_ADDR ) . setEmptyList ( ) ; step . get ( ClientConstants . NAME ) . set ( uniqueName ) ; step . get ( ClientConstants . TO_REPLACE ) . set ( action . getReplacedDeploymentUnitUniqueName ( ) ) ; break ; } case UNDEPLOY : { configureDeploymentOperation ( step , ClientConstants . DEPLOYMENT_UNDEPLOY_OPERATION , uniqueName ) ; break ; } default : { throw new IllegalStateException ( ( "Unknown<seq2seq4repair_space>action<seq2seq4repair_space>type<seq2seq4repair_space>" + ( action . getType ( ) ) ) ) ; } } steps . add ( step ) ; } return builder . build ( ) ; } private void configureDeploymentOperation ( ModelNode op , String operationName , String uniqueName ) { } }

Fix:
step . get ( ClientConstants . CONTENT ) . get ( 0 ) . get ( ClientConstants . INPUT_STREAM_INDEX ) . set ( ( stream ++ ) ) ;