Program: 48882
Project: 48882
Buggy source:
private String createVcResourcePools(List<BaseNode> vNodes){
  logger.info("String_Node_Str");
  String clusterName=vNodes.get(0).getClusterName();
  String uuid=ConfigInfo.getSerengetiUUID();
  String clusterRpName=uuid + "String_Node_Str" + clusterName;
  if (clusterRpName.length() > VC_RP_MAX_NAME_LENGTH) {
    throw ClusteringServiceException.CLUSTER_NAME_TOO_LONG(clusterName);
  }
  Map<String,List<String>> vcClusterRpNamesMap=new HashMap<String,List<String>>();
  Map<Long,List<NodeGroupCreate>> rpNodeGroupsMap=new HashMap<Long,List<NodeGroupCreate>>();
  Map<String,Integer> countResult=collectResourcePoolInfo(vNodes,vcClusterRpNamesMap,rpNodeGroupsMap);
  try {
    int resourcePoolNameCount=countResult.get("String_Node_Str");
    Callable<Void>[] clusterSPs=new Callable[resourcePoolNameCount];
    int i=0;
    for (    Entry<String,List<String>> vcClusterRpNamesEntry : vcClusterRpNamesMap.entrySet()) {
      String vcClusterName=vcClusterRpNamesEntry.getKey();
      VcCluster vcCluster=VcResourceUtils.findVcCluster(vcClusterName);
      if (vcCluster == null) {
        String errorMsg="String_Node_Str" + vcClusterName + "String_Node_Str";
        logger.error(errorMsg);
        throw BddException.INTERNAL(null,errorMsg);
      }
      List<String> resourcePoolNames=vcClusterRpNamesEntry.getValue();
      for (      String resourcePoolName : resourcePoolNames) {
        VcResourcePool parentVcResourcePool=VcResourceUtils.findRPInVCCluster(vcClusterName,resourcePoolName);
        if (parentVcResourcePool == null) {
          String errorMsg="String_Node_Str" + resourcePoolName + "String_Node_Str";
          logger.error(errorMsg);
          throw BddException.INTERNAL(null,errorMsg);
        }
        CreateResourcePoolSP clusterSP=new CreateResourcePoolSP(parentVcResourcePool,clusterRpName);
        clusterSPs[i]=clusterSP;
        i++;
      }
    }
    logger.info("String_Node_Str");
    executeResourcePoolStoreProcedures(clusterSPs,"String_Node_Str",clusterName);
    int nodeGroupNameCount=countResult.get("String_Node_Str");
    Callable<Void>[] nodeGroupSPs=new Callable[nodeGroupNameCount];
    i=0;
    for (    Entry<String,List<String>> vcClusterRpNamesEntry : vcClusterRpNamesMap.entrySet()) {
      String vcClusterName=vcClusterRpNamesEntry.getKey();
      VcCluster vcCluster=VcResourceUtils.findVcCluster(vcClusterName);
      if (vcCluster == null) {
        String errorMsg="String_Node_Str" + vcClusterName + "String_Node_Str";
        logger.error(errorMsg);
        throw BddException.INTERNAL(null,errorMsg);
      }
      if (!vcCluster.getConfig().getDRSEnabled()) {
        continue;
      }
      List<String> resourcePoolNames=vcClusterRpNamesEntry.getValue();
      for (      String resourcePoolName : resourcePoolNames) {
        VcResourcePool parentVcResourcePool=null;
        String vcRPName=CommonUtil.isBlank(resourcePoolName) ? clusterRpName : resourcePoolName + "String_Node_Str" + clusterRpName;
        parentVcResourcePool=VcResourceUtils.findRPInVCCluster(vcClusterName,vcRPName);
        if (parentVcResourcePool == null) {
          String errorMsg="String_Node_Str" + vcRPName + (CommonUtil.isBlank(resourcePoolName) ? "String_Node_Str" : "String_Node_Str" + resourcePoolName)+ "String_Node_Str";
          logger.error(errorMsg);
          throw BddException.INTERNAL(null,errorMsg);
        }
        long rpHashCode=vcClusterName.hashCode() ^ (vcClusterName + resourcePoolName).hashCode();
        for (        NodeGroupCreate nodeGroup : rpNodeGroupsMap.get(rpHashCode)) {
          AuAssert.check(nodeGroup != null,"String_Node_Str");
          if (nodeGroup.getName().length() > 80) {
            throw ClusteringServiceException.GROUP_NAME_TOO_LONG(nodeGroup.getName());
          }
          CreateResourcePoolSP nodeGroupSP=new CreateResourcePoolSP(parentVcResourcePool,nodeGroup.getName(),nodeGroup);
          nodeGroupSPs[i]=nodeGroupSP;
          i++;
        }
      }
    }
    logger.info("String_Node_Str");
    executeResourcePoolStoreProcedures(nodeGroupSPs,"String_Node_Str",clusterName);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw BddException.INTERNAL(e,e.getMessage());
  }
  return clusterRpName;
}

Fixed version (ground truth):
private String createVcResourcePools(List<BaseNode> vNodes){
  logger.info("String_Node_Str");
  String clusterName=vNodes.get(0).getClusterName();
  String uuid=ConfigInfo.getSerengetiUUID();
  String clusterRpName=uuid + "String_Node_Str" + clusterName;
  if (clusterRpName.length() > VC_RP_MAX_NAME_LENGTH) {
    throw ClusteringServiceException.CLUSTER_NAME_TOO_LONG(clusterName);
  }
  Map<String,List<String>> vcClusterRpNamesMap=new HashMap<String,List<String>>();
  Map<Long,List<NodeGroupCreate>> rpNodeGroupsMap=new HashMap<Long,List<NodeGroupCreate>>();
  Map<String,Integer> countResult=collectResourcePoolInfo(vNodes,uuid,vcClusterRpNamesMap,rpNodeGroupsMap);
  try {
    int resourcePoolNameCount=countResult.get("String_Node_Str");
    Callable<Void>[] clusterSPs=new Callable[resourcePoolNameCount];
    int i=0;
    for (    Entry<String,List<String>> vcClusterRpNamesEntry : vcClusterRpNamesMap.entrySet()) {
      String vcClusterName=vcClusterRpNamesEntry.getKey();
      VcCluster vcCluster=VcResourceUtils.findVcCluster(vcClusterName);
      if (vcCluster == null) {
        String errorMsg="String_Node_Str" + vcClusterName + "String_Node_Str";
        logger.error(errorMsg);
        throw BddException.INTERNAL(null,errorMsg);
      }
      List<String> resourcePoolNames=vcClusterRpNamesEntry.getValue();
      for (      String resourcePoolName : resourcePoolNames) {
        VcResourcePool parentVcResourcePool=VcResourceUtils.findRPInVCCluster(vcClusterName,resourcePoolName);
        if (parentVcResourcePool == null) {
          String errorMsg="String_Node_Str" + resourcePoolName + "String_Node_Str";
          logger.error(errorMsg);
          throw BddException.INTERNAL(null,errorMsg);
        }
        CreateResourcePoolSP clusterSP=new CreateResourcePoolSP(parentVcResourcePool,clusterRpName);
        clusterSPs[i]=clusterSP;
        i++;
      }
    }
    logger.info("String_Node_Str");
    executeResourcePoolStoreProcedures(clusterSPs,"String_Node_Str",clusterName);
    int nodeGroupNameCount=countResult.get("String_Node_Str");
    Callable<Void>[] nodeGroupSPs=new Callable[nodeGroupNameCount];
    i=0;
    for (    Entry<String,List<String>> vcClusterRpNamesEntry : vcClusterRpNamesMap.entrySet()) {
      String vcClusterName=vcClusterRpNamesEntry.getKey();
      VcCluster vcCluster=VcResourceUtils.findVcCluster(vcClusterName);
      if (vcCluster == null) {
        String errorMsg="String_Node_Str" + vcClusterName + "String_Node_Str";
        logger.error(errorMsg);
        throw BddException.INTERNAL(null,errorMsg);
      }
      if (!vcCluster.getConfig().getDRSEnabled()) {
        continue;
      }
      List<String> resourcePoolNames=vcClusterRpNamesEntry.getValue();
      for (      String resourcePoolName : resourcePoolNames) {
        VcResourcePool parentVcResourcePool=null;
        String vcRPName=CommonUtil.isBlank(resourcePoolName) ? clusterRpName : resourcePoolName + "String_Node_Str" + clusterRpName;
        parentVcResourcePool=VcResourceUtils.findRPInVCCluster(vcClusterName,vcRPName);
        if (parentVcResourcePool == null) {
          String errorMsg="String_Node_Str" + vcRPName + (CommonUtil.isBlank(resourcePoolName) ? "String_Node_Str" : "String_Node_Str" + resourcePoolName)+ "String_Node_Str";
          logger.error(errorMsg);
          throw BddException.INTERNAL(null,errorMsg);
        }
        String rpPath="String_Node_Str" + vcClusterName + "String_Node_Str"+ resourcePoolName+ "String_Node_Str"+ uuid;
        long rpHashCode=rpPath.hashCode();
        for (        NodeGroupCreate nodeGroup : rpNodeGroupsMap.get(rpHashCode)) {
          AuAssert.check(nodeGroup != null,"String_Node_Str");
          if (nodeGroup.getName().length() > 80) {
            throw ClusteringServiceException.GROUP_NAME_TOO_LONG(nodeGroup.getName());
          }
          CreateResourcePoolSP nodeGroupSP=new CreateResourcePoolSP(parentVcResourcePool,nodeGroup.getName(),nodeGroup);
          nodeGroupSPs[i]=nodeGroupSP;
          i++;
        }
      }
    }
    logger.info("String_Node_Str");
    executeResourcePoolStoreProcedures(nodeGroupSPs,"String_Node_Str",clusterName);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw BddException.INTERNAL(e,e.getMessage());
  }
  return clusterRpName;
}