Program: 48713
Project: 48713
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public boolean createVcVms(List<NetworkAdd> networkAdds,List<BaseNode> vNodes,Map<String,Set<String>> occupiedIpSets,StatusUpdater statusUpdator){
  if (vNodes.isEmpty()) {
    logger.info("String_Node_Str");
    return true;
  }
  updateNicLabels(vNodes);
  allocateStaticIp(vNodes,networkAdds,occupiedIpSets);
  Map<String,Folder> folders=createVcFolders(vNodes.get(0).getCluster());
  String clusterRpName=createVcResourcePools(vNodes);
  logger.info("String_Node_Str");
  VcVmUtil.updateVm(templateVm.getId());
  VmCreateSpec sourceSpec=new VmCreateSpec();
  sourceSpec.setVmId(templateVm.getId());
  sourceSpec.setVmName(templateVm.getName());
  sourceSpec.setTargetHost(templateVm.getHost());
  List<VmCreateSpec> specs=new ArrayList<VmCreateSpec>();
  Map<String,BaseNode> nodeMap=new HashMap<String,BaseNode>();
  for (  BaseNode vNode : vNodes) {
    nodeMap.put(vNode.getVmName(),vNode);
    vNode.setSuccess(false);
    vNode.setFinished(false);
    VmCreateSpec spec=new VmCreateSpec();
    VmSchema createSchema=getVmSchema(vNode);
    spec.setSchema(createSchema);
    String defaultPgName=null;
    GuestMachineIdSpec machineIdSpec=new GuestMachineIdSpec(networkAdds,vNode.fetchPortGroupToIpV4Map(),vNode.getPrimaryMgtPgName());
    logger.info("String_Node_Str" + vNode.getVmName() + "String_Node_Str"+ machineIdSpec.toString());
    spec.setBootupConfigs(machineIdSpec.toGuestVarialbe());
    QueryIpAddress query=new QueryIpAddress(vNode.getNics().keySet(),Constants.VM_POWER_ON_WAITING_SEC);
    spec.setPostPowerOn(query);
    spec.setPrePowerOn(getPrePowerOnFunc(vNode));
    spec.setLinkedClone(false);
    spec.setTargetDs(getVcDatastore(vNode));
    spec.setTargetFolder(folders.get(vNode.getGroupName()));
    spec.setTargetHost(VcResourceUtils.findHost(vNode.getTargetHost()));
    spec.setTargetRp(getVcResourcePool(vNode,clusterRpName));
    spec.setVmName(vNode.getVmName());
    specs.add(spec);
  }
  UpdateVmProgressCallback callback=new UpdateVmProgressCallback(getLockClusterEntityMgr(),statusUpdator,vNodes.get(0).getClusterName());
  logger.info("String_Node_Str");
  AuAssert.check(specs.size() > 0);
  VmSchema vmSchema=specs.get(0).getSchema();
  VcVmUtil.checkAndCreateSnapshot(vmSchema);
  List<VmCreateResult<?>> results=cloneService.createCopies(sourceSpec,cloneConcurrency,specs,callback);
  if (results == null || results.isEmpty()) {
    for (    VmCreateSpec spec : specs) {
      BaseNode node=nodeMap.get(spec.getVmName());
      node.setFinished(true);
      node.setSuccess(false);
    }
    return false;
  }
  boolean success=true;
  int total=0;
  for (  VmCreateResult<?> result : results) {
    VmCreateSpec spec=(VmCreateSpec)result.getSpec();
    BaseNode node=nodeMap.get(spec.getVmName());
    node.setVmMobId(spec.getVmId());
    node.setSuccess(true);
    node.setFinished(true);
    boolean vmSucc=VcVmUtil.setBaseNodeForVm(node,spec.getVmId());
    if (!vmSucc || !result.isSuccess()) {
      success=false;
      node.setSuccess(false);
      node.setErrMessage(result.getErrMessage());
    }
 else {
      total++;
    }
  }
  logger.info(total + "String_Node_Str");
  return success;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public boolean createVcVms(List<NetworkAdd> networkAdds,List<BaseNode> vNodes,Map<String,Set<String>> occupiedIpSets,StatusUpdater statusUpdator){
  if (vNodes.isEmpty()) {
    logger.info("String_Node_Str");
    return true;
  }
  updateNicLabels(vNodes);
  allocateStaticIp(vNodes,networkAdds,occupiedIpSets);
  Map<String,Folder> folders=createVcFolders(vNodes.get(0).getCluster());
  String clusterRpName=createVcResourcePools(vNodes);
  logger.info("String_Node_Str");
  VcVmUtil.updateVm(templateVm.getId());
  VmCreateSpec sourceSpec=new VmCreateSpec();
  sourceSpec.setVmId(templateVm.getId());
  sourceSpec.setVmName(templateVm.getName());
  sourceSpec.setTargetHost(templateVm.getHost());
  List<VmCreateSpec> specs=new ArrayList<VmCreateSpec>();
  Map<String,BaseNode> nodeMap=new HashMap<String,BaseNode>();
  for (  BaseNode vNode : vNodes) {
    nodeMap.put(vNode.getVmName(),vNode);
    vNode.setSuccess(false);
    vNode.setFinished(false);
    VmCreateSpec spec=new VmCreateSpec();
    VmSchema createSchema=getVmSchema(vNode);
    spec.setSchema(createSchema);
    String defaultPgName=null;
    GuestMachineIdSpec machineIdSpec=new GuestMachineIdSpec(networkAdds,vNode.fetchPortGroupToIpV4Map(),vNode.getPrimaryMgtPgName());
    logger.info("String_Node_Str" + vNode.getVmName() + "String_Node_Str"+ machineIdSpec.toString());
    spec.setBootupConfigs(machineIdSpec.toGuestVarialbe());
    QueryIpAddress query=new QueryIpAddress(vNode.getNics().keySet(),Constants.VM_POWER_ON_WAITING_SEC);
    spec.setPostPowerOn(query);
    spec.setPrePowerOn(getPrePowerOnFunc(vNode));
    spec.setLinkedClone(false);
    spec.setTargetDs(getVcDatastore(vNode));
    spec.setTargetFolder(folders.get(vNode.getGroupName()));
    spec.setTargetHost(VcResourceUtils.findHost(vNode.getTargetHost()));
    spec.setTargetRp(getVcResourcePool(vNode,clusterRpName));
    spec.setVmName(vNode.getVmName());
    specs.add(spec);
  }
  UpdateVmProgressCallback callback=new UpdateVmProgressCallback(getLockClusterEntityMgr(),statusUpdator,vNodes.get(0).getClusterName());
  logger.info("String_Node_Str");
  AuAssert.check(specs.size() > 0);
  VmSchema vmSchema=specs.get(0).getSchema();
  VcVmUtil.checkAndCreateSnapshot(vmSchema);
  List<VmCreateResult<?>> results=cloneService.createCopies(sourceSpec,cloneConcurrency,specs,callback);
  if (results == null || results.isEmpty()) {
    for (    VmCreateSpec spec : specs) {
      BaseNode node=nodeMap.get(spec.getVmName());
      node.setFinished(true);
      node.setSuccess(false);
    }
    return false;
  }
  boolean success=true;
  int total=0;
  for (  VmCreateResult<?> result : results) {
    VmCreateSpec spec=(VmCreateSpec)result.getSpec();
    BaseNode node=nodeMap.get(spec.getVmName());
    node.setVmMobId(spec.getVmId());
    node.setSuccess(true);
    node.setFinished(true);
    boolean vmSucc=VcVmUtil.setBaseNodeForVm(node,spec.getVmId());
    if (!vmSucc || !result.isSuccess()) {
      success=false;
      node.setSuccess(false);
      if (result.getErrMessage() != null) {
        node.setErrMessage(result.getErrMessage());
      }
 else {
        node.setErrMessage(node.getNodeAction());
      }
    }
 else {
      total++;
    }
  }
  logger.info(total + "String_Node_Str");
  return success;
}