Program: 48976
Project: 48976
Buggy source:
@Override public boolean reconfigVms(NetworkAdd networkAdd,List<BaseNode> vNodes,StatusUpdater statusUpdator,Set<String> occupiedIps){
  if (vNodes.isEmpty()) {
    logger.info("String_Node_Str");
    return true;
  }
  setNetworkSchema(vNodes);
  allocateStaticIp(networkAdd,vNodes,occupiedIps);
  Pair<Callable<Void>,Callable<Void>>[] storeProcedures=new Pair[vNodes.size()];
  for (int i=0; i < vNodes.size(); i++) {
    BaseNode vNode=vNodes.get(i);
    VmSchema createSchema=getVmSchema(vNode);
    Map<String,String> guestVariable=getNetworkGuestVariable(networkAdd,vNode.getIpAddress(),vNode.getGuestHostName());
    QueryIpAddress query=new QueryIpAddress(Constants.VM_POWER_ON_WAITING_SEC);
    CreateVmPrePowerOn prePowerOn=getPrePowerOnFunc(vNode);
    VcVirtualMachine vcVm=VcCache.getIgnoreMissing(vNode.getVmMobId());
    CreateVmSP cloneVmSp=null;
    if (vcVm != null) {
      cloneVmSp=new CreateVmSP(vcVm,createSchema,vNode.getTargetVcRp(),vNode.getTargetVcDs(),prePowerOn,query,guestVariable,false,vNode.getTargetVcFolder(),vNode.getTargetVcHost());
    }
 else {
      cloneVmSp=new CreateVmSP(vNode.getVmName(),createSchema,vNode.getTargetVcRp(),vNode.getTargetVcDs(),prePowerOn,query,guestVariable,false,vNode.getTargetVcFolder(),vNode.getTargetVcHost());
    }
    CompensateCreateVmSP deleteVmSp=new CompensateCreateVmSP(cloneVmSp);
    storeProcedures[i]=new Pair<Callable<Void>,Callable<Void>>(cloneVmSp,deleteVmSp);
  }
  try {
    UpdateVmProgressCallback callback=new UpdateVmProgressCallback(clusterEntityMgr,statusUpdator,vNodes.get(0).getClusterName());
    logger.info("String_Node_Str");
    Pair<ExecutionResult,ExecutionResult>[] result=Scheduler.executeStoredProcedures(com.vmware.aurora.composition.concurrent.Priority.BACKGROUND,storeProcedures,storeProcedures.length,callback);
    if (result == null) {
      logger.error("String_Node_Str");
      return false;
    }
    int total=0;
    boolean success=true;
    List<BaseNode> failedNodes=new ArrayList<BaseNode>();
    for (int i=0; i < storeProcedures.length; i++) {
      Pair<ExecutionResult,ExecutionResult> pair=result[i];
      BaseNode vNode=vNodes.get(i);
      CreateVmSP sp=(CreateVmSP)storeProcedures[i].first;
      if (pair.first.finished && pair.first.throwable == null && pair.second.finished == false) {
        ++total;
        VcVirtualMachine vm=sp.getVM();
        AuAssert.check(vm != null);
        boolean vmSucc=VcVmUtil.setBaseNodeForVm(vNode,vm);
        if (!vmSucc) {
          success=vmSucc;
        }
      }
 else       if (pair.first.throwable != null) {
        processException(pair.first.throwable);
        logger.error("String_Node_Str" + vNode.getVmName(),pair.first.throwable);
        vNode.setSuccess(false);
        if (sp.getVM() != null) {
          vNode.setVmMobId(sp.getVM().getId());
        }
        failedNodes.add(vNode);
        success=false;
      }
      vNode.setFinished(true);
    }
    logger.info(total + "String_Node_Str");
    return success;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw BddException.INTERNAL(e,e.getMessage());
  }
}

Fixed version (ground truth):
@Override public boolean reconfigVms(NetworkAdd networkAdd,List<BaseNode> vNodes,StatusUpdater statusUpdator,Set<String> occupiedIps){
  if (vNodes.isEmpty()) {
    logger.info("String_Node_Str");
    return true;
  }
  setNetworkSchema(vNodes);
  allocateStaticIp(networkAdd,vNodes,occupiedIps);
  Pair<Callable<Void>,Callable<Void>>[] storeProcedures=new Pair[vNodes.size()];
  String uuid=ConfigInfo.getSerengetiUUID();
  String clusterRpName=uuid + "String_Node_Str" + vNodes.get(0).getClusterName();
  for (int i=0; i < vNodes.size(); i++) {
    BaseNode vNode=vNodes.get(i);
    VmSchema createSchema=getVmSchema(vNode);
    Map<String,String> guestVariable=getNetworkGuestVariable(networkAdd,vNode.getIpAddress(),vNode.getGuestHostName());
    QueryIpAddress query=new QueryIpAddress(Constants.VM_POWER_ON_WAITING_SEC);
    CreateVmPrePowerOn prePowerOn=getPrePowerOnFunc(vNode);
    VcVirtualMachine vcVm=VcCache.getIgnoreMissing(vNode.getVmMobId());
    CreateVmSP cloneVmSp=null;
    if (vcVm != null) {
      cloneVmSp=new CreateVmSP(vcVm,createSchema,getVcResourcePool(vNode,clusterRpName),getVcDatastore(vNode),prePowerOn,query,guestVariable,false,getVcFolder(vNode),VcResourceUtils.findHost(vNode.getTargetHost()));
    }
 else {
      cloneVmSp=new CreateVmSP(vNode.getVmName(),createSchema,getVcResourcePool(vNode,clusterRpName),getVcDatastore(vNode),prePowerOn,query,guestVariable,false,getVcFolder(vNode),VcResourceUtils.findHost(vNode.getTargetHost()));
    }
    CompensateCreateVmSP deleteVmSp=new CompensateCreateVmSP(cloneVmSp);
    storeProcedures[i]=new Pair<Callable<Void>,Callable<Void>>(cloneVmSp,deleteVmSp);
  }
  try {
    UpdateVmProgressCallback callback=new UpdateVmProgressCallback(clusterEntityMgr,statusUpdator,vNodes.get(0).getClusterName());
    logger.info("String_Node_Str");
    Pair<ExecutionResult,ExecutionResult>[] result=Scheduler.executeStoredProcedures(com.vmware.aurora.composition.concurrent.Priority.BACKGROUND,storeProcedures,storeProcedures.length,callback);
    if (result == null) {
      logger.error("String_Node_Str");
      return false;
    }
    int total=0;
    boolean success=true;
    List<BaseNode> failedNodes=new ArrayList<BaseNode>();
    for (int i=0; i < storeProcedures.length; i++) {
      Pair<ExecutionResult,ExecutionResult> pair=result[i];
      BaseNode vNode=vNodes.get(i);
      CreateVmSP sp=(CreateVmSP)storeProcedures[i].first;
      if (pair.first.finished && pair.first.throwable == null && pair.second.finished == false) {
        ++total;
        VcVirtualMachine vm=sp.getVM();
        AuAssert.check(vm != null);
        boolean vmSucc=VcVmUtil.setBaseNodeForVm(vNode,vm);
        if (!vmSucc) {
          success=vmSucc;
        }
      }
 else       if (pair.first.throwable != null) {
        processException(pair.first.throwable);
        logger.error("String_Node_Str" + vNode.getVmName(),pair.first.throwable);
        vNode.setSuccess(false);
        if (sp.getVM() != null) {
          vNode.setVmMobId(sp.getVM().getId());
        }
        failedNodes.add(vNode);
        success=false;
      }
      vNode.setFinished(true);
    }
    logger.info(total + "String_Node_Str");
    return success;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw BddException.INTERNAL(e,e.getMessage());
  }
}