Program: 168005
Project: 168005
Buggy source:
/** 
 * Creates an update object for the given action and adds it to the overall update.
 * @param action the action
 * @param resultHandler the handler for the result of the action
 * @param overallUpdate the overall update
 */
private void addServerGroupDeploymentUpdate(DeploymentActionImpl action,UpdateResultHandler<ServerDeploymentActionResult,UUID> resultHandler,final ServerUpdateController controller){
switch (action.getType()) {
case ADD:
{
      controller.addServerModelUpdate(new ServerModelDeploymentAdd(action.getDeploymentUnitUniqueName(),action.getNewContentFileName(),action.getNewContentHash(),false),resultHandler,action.getId());
      break;
    }
case REMOVE:
{
    controller.addServerModelUpdate(new ServerModelDeploymentRemove(action.getDeploymentUnitUniqueName(),false),resultHandler,action.getId());
    break;
  }
case DEPLOY:
{
  ServerGroupDeploymentStartStopUpdate support=new ServerGroupDeploymentStartStopUpdate(action.getDeploymentUnitUniqueName(),true);
  controller.addServerModelUpdate(new ServerModelDeploymentStartStopUpdate(support),resultHandler,action.getId());
  break;
}
case UNDEPLOY:
{
ServerGroupDeploymentStartStopUpdate support=new ServerGroupDeploymentStartStopUpdate(action.getDeploymentUnitUniqueName(),false);
controller.addServerModelUpdate(new ServerModelDeploymentStartStopUpdate(support),resultHandler,action.getId());
break;
}
case REDEPLOY:
{
controller.addServerModelUpdate(new ServerModelDeploymentReplaceUpdate(action.getDeploymentUnitUniqueName(),action.getDeploymentUnitUniqueName()),resultHandler,action.getId());
break;
}
case REPLACE:
{
controller.addServerModelUpdate(new ServerModelDeploymentReplaceUpdate(action.getDeploymentUnitUniqueName(),action.getReplacedDeploymentUnitUniqueName()),resultHandler,action.getId());
break;
}
case FULL_REPLACE:
controller.addServerModelUpdate(new ServerModelDeploymentFullReplaceUpdate(action.getDeploymentUnitUniqueName(),action.getNewContentFileName(),action.getNewContentHash()),resultHandler,action.getId());
break;
default :
{
throw new IllegalStateException("String_Node_Str" + action.getType());
}
}
}

Fixed version (ground truth):
/** 
 * Creates an update object for the given action and adds it to the overall update.
 * @param action the action
 * @param resultHandler the handler for the result of the action
 * @param overallUpdate the overall update
 */
private void addServerGroupDeploymentUpdate(DeploymentActionImpl action,UpdateResultHandler<? super ServerDeploymentActionResult,UUID> resultHandler,final ServerUpdateController controller){
switch (action.getType()) {
case ADD:
{
      controller.addServerModelUpdate(new ServerModelDeploymentAdd(action.getDeploymentUnitUniqueName(),action.getNewContentFileName(),action.getNewContentHash()),resultHandler,action.getId());
      break;
    }
case REMOVE:
{
    controller.addServerModelUpdate(new ServerModelDeploymentRemove(action.getDeploymentUnitUniqueName()),resultHandler,action.getId());
    break;
  }
case DEPLOY:
{
  controller.addServerModelUpdate(new ServerModelDeploymentStartStopUpdate(action.getDeploymentUnitUniqueName(),true),resultHandler,action.getId());
  break;
}
case UNDEPLOY:
{
controller.addServerModelUpdate(new ServerModelDeploymentStartStopUpdate(action.getDeploymentUnitUniqueName(),false),resultHandler,action.getId());
break;
}
case REDEPLOY:
{
controller.addServerModelUpdate(new ServerModelDeploymentReplaceUpdate(action.getDeploymentUnitUniqueName(),action.getDeploymentUnitUniqueName()),resultHandler,action.getId());
break;
}
case REPLACE:
{
controller.addServerModelUpdate(new ServerModelDeploymentReplaceUpdate(action.getDeploymentUnitUniqueName(),action.getReplacedDeploymentUnitUniqueName()),resultHandler,action.getId());
break;
}
case FULL_REPLACE:
ServerGroupDeploymentElement deployment=serverConfiguration.getDeployment(action.getDeploymentUnitUniqueName());
boolean redeploy=deployment != null && deployment.isStart();
controller.addServerModelUpdate(new ServerModelDeploymentFullReplaceUpdate(action.getDeploymentUnitUniqueName(),action.getNewContentFileName(),action.getNewContentHash(),redeploy),resultHandler,action.getId());
break;
default :
{
throw new IllegalStateException("String_Node_Str" + action.getType());
}
}
}