nus-yam/ex-repair huggingface dataset:
Program: 48841
Project: 48841
Buggy source:
private void makeVmMemoryDivisibleBy4(NodeGroupCreate nodeGroup,List<String> warningMsgList){
  int memoryCap=nodeGroup.getMemCapacityMB();
  if (memoryCap > 0) {
    long converted=CommonUtil.makeVmMemoryDivisibleBy4(memoryCap);
    if (converted < memoryCap) {
      nodeGroup.setMemCapacityMB((int)converted);
      warningMsgList.add(Constants.CONVERTED_MEMORY_DIVISIBLE_BY_4 + "String_Node_Str" + nodeGroup.getName()+ "String_Node_Str"+ converted+ "String_Node_Str"+ memoryCap+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void makeVmMemoryDivisibleBy4(NodeGroupCreate nodeGroup,List<String> warningMsgList){
  int memoryNum=nodeGroup.getMemCapacityMB();
  if (memoryNum > 0) {
    long converted=CommonUtil.makeVmMemoryDivisibleBy4(memoryNum);
    if (converted < memoryNum) {
      nodeGroup.setMemCapacityMB((int)converted);
      warningMsgList.add(Constants.CONVERTED_MEMORY_DIVISIBLE_BY_4 + "String_Node_Str" + nodeGroup.getName()+ "String_Node_Str"+ converted+ "String_Node_Str"+ memoryNum+ "String_Node_Str");
    }
  }
}
Program: 48843
Project: 48843
Buggy source:
public void testClusterConfigWithGroupSlave(){
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  spec.setNetworkConfig(createNetConfigs());
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  NodeGroupCreate[] nodegroups=new NodeGroupCreate[1];
  NodeGroupCreate group=new NodeGroupCreate();
  nodegroups[0]=group;
  group.setCpuNum(3);
  group.setInstanceNum(10);
  group.setCpuNum(2);
  group.setMemCapacityMB(7500);
  group.setInstanceType(InstanceType.SMALL);
  group.setHaFlag("String_Node_Str");
  group.setName("String_Node_Str");
  List<String> roles=new ArrayList<String>();
  roles.add("String_Node_Str");
  group.setRoles(roles);
  spec.setNodeGroups(nodegroups);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1 && manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}

Fixed version (ground truth):
public void testClusterConfigWithGroupSlave(){
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  spec.setNetworkConfig(createNetConfigs());
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  NodeGroupCreate[] nodegroups=new NodeGroupCreate[1];
  NodeGroupCreate group=new NodeGroupCreate();
  nodegroups[0]=group;
  group.setCpuNum(3);
  group.setInstanceNum(10);
  group.setInstanceType(InstanceType.SMALL);
  group.setHaFlag("String_Node_Str");
  group.setName("String_Node_Str");
  List<String> roles=new ArrayList<String>();
  roles.add("String_Node_Str");
  group.setRoles(roles);
  spec.setNodeGroups(nodegroups);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1 && manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}
Program: 48844
Project: 48844
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test(groups={"String_Node_Str"}) public void testClusterAppConfig() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setType(ClusterType.HDFS_MAPRED);
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  for (  NodeGroupCreate nodeGroup : spec.getNodeGroups()) {
    nodeGroup.setCpuNum(2);
    nodeGroup.setMemCapacityMB(7500);
  }
  spec.setType(null);
  String configJson="String_Node_Str";
  Map config=(new Gson()).fromJson(configJson,Map.class);
  spec.setConfiguration((Map<String,Object>)(config.get("String_Node_Str")));
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test(groups={"String_Node_Str"}) public void testClusterAppConfig() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setType(ClusterType.HDFS_MAPRED);
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  spec.setType(null);
  String configJson="String_Node_Str";
  Map config=(new Gson()).fromJson(configJson,Map.class);
  spec.setConfiguration((Map<String,Object>)(config.get("String_Node_Str")));
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}
Program: 48846
Project: 48846
Buggy source:
@Test(groups={"String_Node_Str"}) public void testClusterConfigWithClusterStorage() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  spec.setNetworkConfig(createNetConfigs());
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  List<String> dsNames=new ArrayList<String>();
  dsNames.add("String_Node_Str");
  dsNames.add("String_Node_Str");
  spec.setDsNames(dsNames);
  spec.setType(ClusterType.HDFS_MAPRED);
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  for (  NodeGroupCreate nodeGroup : spec.getNodeGroups()) {
    nodeGroup.setCpuNum(2);
    nodeGroup.setMemCapacityMB(7500);
  }
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testClusterConfigWithClusterStorage() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  spec.setNetworkConfig(createNetConfigs());
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  List<String> dsNames=new ArrayList<String>();
  dsNames.add("String_Node_Str");
  dsNames.add("String_Node_Str");
  spec.setDsNames(dsNames);
  spec.setType(ClusterType.HDFS_MAPRED);
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}
Program: 48847
Project: 48847
Buggy source:
@Test(groups={"String_Node_Str"}) public void testClusterConfig() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec.setType(ClusterType.HDFS_MAPRED);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  for (  NodeGroupCreate nodeGroup : spec.getNodeGroups()) {
    nodeGroup.setCpuNum(2);
    nodeGroup.setMemCapacityMB(7500);
  }
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testClusterConfig() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec.setType(ClusterType.HDFS_MAPRED);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}
Program: 48850
Project: 48850
Buggy source:
private CreateVmSP getReplacementVmSp(ClusterCreate clusterSpec,String groupName,NodeEntity node,List<DiskSpec> fullDiskSet){
  VmSchema createSchema=VcVmUtil.getVmSchema(clusterSpec,groupName,fullDiskSet,clusteringService.getTemplateVmId(),Constants.ROOT_SNAPSTHOT_NAME);
  List<NetworkAdd> networkAdds=clusterSpec.getNetworkings();
  GuestMachineIdSpec machineIdSpec=new GuestMachineIdSpec(networkAdds,node.fetchPortGroupToIpMap(),node.getGuestHostName());
  logger.info("String_Node_Str" + node.getVmName() + "String_Node_Str"+ machineIdSpec.toString());
  Map<String,String> guestVariable=machineIdSpec.toGuestVarialbe();
  VcVmUtil.addBootupUUID(guestVariable);
  String haFlag=clusterSpec.getNodeGroup(groupName).getHaFlag();
  boolean ha=false;
  boolean ft=false;
  if (haFlag != null && Constants.HA_FLAG_ON.equals(haFlag.toLowerCase())) {
    ha=true;
  }
  if (haFlag != null && Constants.HA_FLAG_FT.equals(haFlag.toLowerCase())) {
    ha=true;
    ft=true;
  }
  ReplaceVmPrePowerOn prePowerOn=new ReplaceVmPrePowerOn(node.getMoId(),node.getVmName(),clusterSpec.getNodeGroup(groupName).getStorage().getShares(),createSchema.networkSchema,ha,ft);
  return new CreateVmSP(node.getVmName() + RECOVERY_VM_NAME_POSTFIX,createSchema,VcVmUtil.getTargetRp(clusterSpec.getName(),groupName,node),getTargetDatastore(fullDiskSet),prePowerOn,null,guestVariable,false,getTargetFolder(node,clusterSpec.getNodeGroup(groupName)),getTargetHost(node));
}

Fixed version (ground truth):
private CreateVmSP getReplacementVmSp(ClusterCreate clusterSpec,String groupName,NodeEntity node,List<DiskSpec> fullDiskSet){
  VmSchema createSchema=VcVmUtil.getVmSchema(clusterSpec,groupName,fullDiskSet,clusteringService.getTemplateVmId(),Constants.ROOT_SNAPSTHOT_NAME);
  List<NetworkAdd> networkAdds=clusterSpec.getNetworkings();
  GuestMachineIdSpec machineIdSpec=new GuestMachineIdSpec(networkAdds,node.fetchPortGroupToIpMap(),node.getIpConfigsInfo().get(NetConfigInfo.NetTrafficType.MGT_NETWORK).get(0).getPortGroupName());
  logger.info("String_Node_Str" + node.getVmName() + "String_Node_Str"+ machineIdSpec.toString());
  Map<String,String> guestVariable=machineIdSpec.toGuestVarialbe();
  VcVmUtil.addBootupUUID(guestVariable);
  String haFlag=clusterSpec.getNodeGroup(groupName).getHaFlag();
  boolean ha=false;
  boolean ft=false;
  if (haFlag != null && Constants.HA_FLAG_ON.equals(haFlag.toLowerCase())) {
    ha=true;
  }
  if (haFlag != null && Constants.HA_FLAG_FT.equals(haFlag.toLowerCase())) {
    ha=true;
    ft=true;
  }
  ReplaceVmPrePowerOn prePowerOn=new ReplaceVmPrePowerOn(node.getMoId(),node.getVmName(),clusterSpec.getNodeGroup(groupName).getStorage().getShares(),createSchema.networkSchema,ha,ft);
  return new CreateVmSP(node.getVmName() + RECOVERY_VM_NAME_POSTFIX,createSchema,VcVmUtil.getTargetRp(clusterSpec.getName(),groupName,node),getTargetDatastore(fullDiskSet),prePowerOn,null,guestVariable,false,getTargetFolder(node,clusterSpec.getNodeGroup(groupName)),getTargetHost(node));
}
Program: 48852
Project: 48852
Buggy source:
public Map<String,String> toGuestVarialbe(){
  Map<String,String> guestVarialbe=new HashMap<String,String>();
  Gson gson=new Gson();
  guestVarialbe.put(Constants.GUEST_VARIABLE_NIC_DEVICES,gson.toJson(nics));
  NicDeviceConfigSpec defaultNic=null;
  for (  NicDeviceConfigSpec nic : nics) {
    if (nic.getPortGroupName().equals(defaultPg)) {
      defaultNic=nic;
      break;
    }
  }
  AuAssert.check(defaultNic != null);
  guestVarialbe.put(Constants.GUEST_VARIABLE_POLICY_KEY,defaultNic.getBootProto());
  guestVarialbe.put(Constants.GUEST_VARIABLE_PORT_GROUP,defaultNic.getPortGroupName());
  guestVarialbe.put(Constants.GUEST_VARIABLE_IP_KEY,defaultNic.getIpAddress());
  guestVarialbe.put(Constants.GUEST_VARIABLE_GATEWAY_KEY,defaultNic.getGateway());
  guestVarialbe.put(Constants.GUEST_VARIABLE_NETMASK_KEY,defaultNic.getNetmask());
  guestVarialbe.put(Constants.GUEST_VARIABLE_DNS_KEY_0,defaultNic.getDnsServer0());
  guestVarialbe.put(Constants.GUEST_VARIABLE_DNS_KEY_1,defaultNic.getDnsServer1());
  return guestVarialbe;
}

Fixed version (ground truth):
public Map<String,String> toGuestVarialbe(){
  Map<String,String> guestVarialbe=new HashMap<String,String>();
  Gson gson=new Gson();
  guestVarialbe.put(Constants.GUEST_VARIABLE_NIC_DEVICES,gson.toJson(nics));
  NicDeviceConfigSpec defaultNic=null;
  if (defaultPg == null) {
    defaultNic=nics[0];
  }
 else {
    for (    NicDeviceConfigSpec nic : nics) {
      if (nic.getPortGroupName().equals(defaultPg)) {
        defaultNic=nic;
        break;
      }
    }
  }
  AuAssert.check(defaultNic != null);
  guestVarialbe.put(Constants.GUEST_VARIABLE_POLICY_KEY,defaultNic.getBootProto());
  guestVarialbe.put(Constants.GUEST_VARIABLE_PORT_GROUP,defaultNic.getPortGroupName());
  guestVarialbe.put(Constants.GUEST_VARIABLE_IP_KEY,defaultNic.getIpAddress());
  guestVarialbe.put(Constants.GUEST_VARIABLE_GATEWAY_KEY,defaultNic.getGateway());
  guestVarialbe.put(Constants.GUEST_VARIABLE_NETMASK_KEY,defaultNic.getNetmask());
  guestVarialbe.put(Constants.GUEST_VARIABLE_DNS_KEY_0,defaultNic.getDnsServer0());
  guestVarialbe.put(Constants.GUEST_VARIABLE_DNS_KEY_1,defaultNic.getDnsServer1());
  return guestVarialbe;
}
Program: 48854
Project: 48854
Buggy source:
@Override public RepeatStatus executeStep(ChunkContext chunkContext,JobExecutionStatusHolder jobExecutionStatusHolder){
  String clusterName=getJobParameters(chunkContext).getString(JobConstants.CLUSTER_NAME_JOB_PARAM);
  ClusterCreate clusterSpec=configMgr.getClusterConfig(clusterName);
  String newPassword=clusterSpec.getPassword();
  if (newPassword == null) {
    logger.info("String_Node_Str");
    return RepeatStatus.FINISHED;
  }
  List<BaseNode> addedNodes=getFromJobExecutionContext(chunkContext,JobConstants.CLUSTER_ADDED_NODES_JOB_PARAM,new TypeToken<List<BaseNode>>(){
  }
.getType());
  ArrayList<String> ipOfAddedNodes=getAddedNodeIPs(addedNodes);
  if (ipOfAddedNodes.isEmpty()) {
    throw TaskException.EXECUTION_FAILED("String_Node_Str");
  }
  ArrayList<String> failedNodes=setPasswordService.setPasswordForNodes(clusterName,ipOfAddedNodes,newPassword);
  boolean success=false;
  if (failedNodes == null) {
    success=true;
  }
 else {
    logger.info("String_Node_Str" + failedNodes.toString());
  }
  putIntoJobExecutionContext(chunkContext,JobConstants.CLUSTER_EXISTING_NODES_JOB_PARAM,success);
  if (!success) {
    throw TaskException.EXECUTION_FAILED("String_Node_Str" + failedNodes.toString());
  }
  return RepeatStatus.FINISHED;
}

Fixed version (ground truth):
@Override public RepeatStatus executeStep(ChunkContext chunkContext,JobExecutionStatusHolder jobExecutionStatusHolder){
  String clusterName=getJobParameters(chunkContext).getString(JobConstants.CLUSTER_NAME_JOB_PARAM);
  ClusterCreate clusterSpec=configMgr.getClusterConfig(clusterName);
  String newPassword=clusterSpec.getPassword();
  if (newPassword == null) {
    logger.info("String_Node_Str");
    return RepeatStatus.FINISHED;
  }
  ArrayList<String> nodeIPs=null;
  if (managementOperation == ManagementOperation.CREATE || managementOperation == ManagementOperation.RESIZE) {
    List<BaseNode> addedNodes=getFromJobExecutionContext(chunkContext,JobConstants.CLUSTER_ADDED_NODES_JOB_PARAM,new TypeToken<List<BaseNode>>(){
    }
.getType());
    nodeIPs=getAddedNodeIPs(addedNodes);
  }
 else   if (managementOperation == ManagementOperation.RESUME) {
    nodeIPs=getAllNodeIPsFromEntitys(entityMgr.findAllNodes(clusterName));
  }
 else {
    throw TaskException.EXECUTION_FAILED("String_Node_Str");
  }
  if (nodeIPs == null) {
    throw TaskException.EXECUTION_FAILED("String_Node_Str");
  }
  ArrayList<String> failedNodes=setPasswordService.setPasswordForNodes(clusterName,nodeIPs,newPassword);
  boolean success=false;
  if (failedNodes == null) {
    success=true;
  }
 else {
    logger.info("String_Node_Str" + failedNodes.toString());
  }
  putIntoJobExecutionContext(chunkContext,JobConstants.CLUSTER_EXISTING_NODES_JOB_PARAM,success);
  if (!success) {
    throw TaskException.EXECUTION_FAILED("String_Node_Str" + failedNodes.toString());
  }
  return RepeatStatus.FINISHED;
}
Program: 48855
Project: 48855
Buggy source:
private ArrayList<String> getAddedNodeIPs(List<BaseNode> addedNodes){
  ArrayList<String> nodeIPs=null;
  for (  BaseNode node : addedNodes) {
    Map<NetTrafficType,List<IpConfigInfo>> ipConfigs=node.getIpConfigs();
    if (!ipConfigs.containsKey(NetTrafficType.MGT_NETWORK)) {
      logger.error("String_Node_Str");
      return nodeIPs;
    }
    if (nodeIPs == null) {
      nodeIPs=new ArrayList<String>();
    }
    nodeIPs.add(ipConfigs.get(NetTrafficType.MGT_NETWORK).get(0).getIpAddress());
  }
  return nodeIPs;
}

Fixed version (ground truth):
private ArrayList<String> getAddedNodeIPs(List<BaseNode> addedNodes){
  if (addedNodes == null) {
    return null;
  }
  ArrayList<String> nodeIPs=null;
  for (  BaseNode node : addedNodes) {
    Map<NetTrafficType,List<IpConfigInfo>> ipConfigs=node.getIpConfigs();
    if (!ipConfigs.containsKey(NetTrafficType.MGT_NETWORK)) {
      logger.error("String_Node_Str");
      return nodeIPs;
    }
    if (nodeIPs == null) {
      nodeIPs=new ArrayList<String>();
    }
    nodeIPs.add(ipConfigs.get(NetTrafficType.MGT_NETWORK).get(0).getIpAddress());
  }
  return nodeIPs;
}
Program: 48856
Project: 48856
Buggy source:
/** 
 * Add successfully created node, which information is got from vc creation. If deleted any VM, or nodes during vm creation step, which may violate placement policy. We'll remove the node if it's not re-created.
 * @param clusterName
 * @param addedNodes
 * @param deletedNodeNames
 * @return
 */
public void addNodeToMetaData(String clusterName,List<BaseNode> addedNodes,Set<String> deletedNodeNames){
  if (addedNodes == null || addedNodes.isEmpty()) {
    logger.info("String_Node_Str");
    return;
  }
  for (  BaseNode vNode : addedNodes) {
    deletedNodeNames.remove(vNode.getVmName());
synchronized (getClusterEntityMgr()) {
      replaceNodeEntity(vNode);
    }
  }
}

Fixed version (ground truth):
/** 
 * Add successfully created node, which information is got from vc creation. If deleted any VM, or nodes during vm creation step, which may violate placement policy. We'll remove the node if it's not re-created.
 * @param clusterName
 * @param addedNodes
 * @param deletedNodeNames
 * @return
 */
public void addNodeToMetaData(String clusterName,List<BaseNode> addedNodes,Set<String> deletedNodeNames){
  if (addedNodes == null || addedNodes.isEmpty()) {
    logger.info("String_Node_Str");
    return;
  }
  for (  BaseNode vNode : addedNodes) {
    deletedNodeNames.remove(vNode.getVmName());
    replaceNodeEntity(vNode);
  }
}
Program: 48857
Project: 48857
Buggy source:
@Override public RepeatStatus executeStep(ChunkContext chunkContext,JobExecutionStatusHolder jobExecutionStatusHolder) throws Exception {
  String clusterName=getJobParameters(chunkContext).getString(JobConstants.CLUSTER_NAME_JOB_PARAM);
  List<BaseNode> addedNodes=getFromJobExecutionContext(chunkContext,JobConstants.CLUSTER_ADDED_NODES_JOB_PARAM,new TypeToken<List<BaseNode>>(){
  }
.getType());
  List<BaseNode> deletedNodes=getFromJobExecutionContext(chunkContext,JobConstants.CLUSTER_DELETED_NODES_JOB_PARAM,new TypeToken<List<BaseNode>>(){
  }
.getType());
  Set<String> deletedNodeNames=new HashSet<String>();
  if (deletedNodes != null) {
    for (    BaseNode node : deletedNodes) {
      deletedNodeNames.add(node.getVmName());
    }
  }
  addNodeToMetaData(clusterName,addedNodes,deletedNodeNames);
  removeDeletedNode(clusterName,deletedNodeNames);
  return RepeatStatus.FINISHED;
}

Fixed version (ground truth):
@Override public RepeatStatus executeStep(ChunkContext chunkContext,JobExecutionStatusHolder jobExecutionStatusHolder) throws Exception {
  String clusterName=getJobParameters(chunkContext).getString(JobConstants.CLUSTER_NAME_JOB_PARAM);
  List<BaseNode> addedNodes=getFromJobExecutionContext(chunkContext,JobConstants.CLUSTER_ADDED_NODES_JOB_PARAM,new TypeToken<List<BaseNode>>(){
  }
.getType());
  List<BaseNode> deletedNodes=getFromJobExecutionContext(chunkContext,JobConstants.CLUSTER_DELETED_NODES_JOB_PARAM,new TypeToken<List<BaseNode>>(){
  }
.getType());
  Set<String> deletedNodeNames=new HashSet<String>();
  if (deletedNodes != null) {
    for (    BaseNode node : deletedNodes) {
      deletedNodeNames.add(node.getVmName());
    }
  }
synchronized (getClusterEntityMgr()) {
    addNodeToMetaData(clusterName,addedNodes,deletedNodeNames);
    removeDeletedNode(clusterName,deletedNodeNames);
  }
  return RepeatStatus.FINISHED;
}
Program: 48860
Project: 48860
Buggy source:
private void makeVmMemoryDivisibleBy4(NodeGroupCreate nodeGroup,List<String> warningMsgList){
  int memoryNum=nodeGroup.getMemCapacityMB();
  if (memoryNum > 0) {
    long converted=CommonUtil.makeVmMemoryDivisibleBy4(memoryNum);
    if (converted < memoryNum) {
      nodeGroup.setMemCapacityMB((int)converted);
      warningMsgList.add(Constants.CONVERTED_MEMORY_DIVISIBLE_BY_4 + "String_Node_Str" + nodeGroup.getName()+ "String_Node_Str"+ converted+ "String_Node_Str"+ memoryNum+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void makeVmMemoryDivisibleBy4(NodeGroupCreate nodeGroup,List<String> warningMsgList){
  int memoryCap=nodeGroup.getMemCapacityMB();
  if (memoryCap > 0) {
    long converted=CommonUtil.makeVmMemoryDivisibleBy4(memoryCap);
    if (converted < memoryCap) {
      nodeGroup.setMemCapacityMB((int)converted);
      warningMsgList.add(Constants.CONVERTED_MEMORY_DIVISIBLE_BY_4 + "String_Node_Str" + nodeGroup.getName()+ "String_Node_Str"+ converted+ "String_Node_Str"+ memoryCap+ "String_Node_Str");
    }
  }
}
Program: 48862
Project: 48862
Buggy source:
public void testClusterConfigWithGroupSlave(){
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  spec.setNetworkConfig(createNetConfigs());
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  NodeGroupCreate[] nodegroups=new NodeGroupCreate[1];
  NodeGroupCreate group=new NodeGroupCreate();
  nodegroups[0]=group;
  group.setCpuNum(3);
  group.setInstanceNum(10);
  group.setInstanceType(InstanceType.SMALL);
  group.setHaFlag("String_Node_Str");
  group.setName("String_Node_Str");
  List<String> roles=new ArrayList<String>();
  roles.add("String_Node_Str");
  group.setRoles(roles);
  spec.setNodeGroups(nodegroups);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1 && manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}

Fixed version (ground truth):
public void testClusterConfigWithGroupSlave(){
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  spec.setNetworkConfig(createNetConfigs());
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  NodeGroupCreate[] nodegroups=new NodeGroupCreate[1];
  NodeGroupCreate group=new NodeGroupCreate();
  nodegroups[0]=group;
  group.setCpuNum(3);
  group.setInstanceNum(10);
  group.setCpuNum(2);
  group.setMemCapacityMB(7500);
  group.setInstanceType(InstanceType.SMALL);
  group.setHaFlag("String_Node_Str");
  group.setName("String_Node_Str");
  List<String> roles=new ArrayList<String>();
  roles.add("String_Node_Str");
  group.setRoles(roles);
  spec.setNodeGroups(nodegroups);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1 && manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}
Program: 48863
Project: 48863
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test(groups={"String_Node_Str"}) public void testClusterAppConfig() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setType(ClusterType.HDFS_MAPRED);
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  spec.setType(null);
  String configJson="String_Node_Str";
  Map config=(new Gson()).fromJson(configJson,Map.class);
  spec.setConfiguration((Map<String,Object>)(config.get("String_Node_Str")));
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test(groups={"String_Node_Str"}) public void testClusterAppConfig() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setType(ClusterType.HDFS_MAPRED);
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  for (  NodeGroupCreate nodeGroup : spec.getNodeGroups()) {
    nodeGroup.setCpuNum(2);
    nodeGroup.setMemCapacityMB(7500);
  }
  spec.setType(null);
  String configJson="String_Node_Str";
  Map config=(new Gson()).fromJson(configJson,Map.class);
  spec.setConfiguration((Map<String,Object>)(config.get("String_Node_Str")));
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}
Program: 48865
Project: 48865
Buggy source:
@Test(groups={"String_Node_Str"}) public void testClusterConfigWithClusterStorage() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  spec.setNetworkConfig(createNetConfigs());
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  List<String> dsNames=new ArrayList<String>();
  dsNames.add("String_Node_Str");
  dsNames.add("String_Node_Str");
  spec.setDsNames(dsNames);
  spec.setType(ClusterType.HDFS_MAPRED);
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testClusterConfigWithClusterStorage() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  spec.setNetworkConfig(createNetConfigs());
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  List<String> dsNames=new ArrayList<String>();
  dsNames.add("String_Node_Str");
  dsNames.add("String_Node_Str");
  spec.setDsNames(dsNames);
  spec.setType(ClusterType.HDFS_MAPRED);
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  for (  NodeGroupCreate nodeGroup : spec.getNodeGroups()) {
    nodeGroup.setCpuNum(2);
    nodeGroup.setMemCapacityMB(7500);
  }
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}
Program: 48866
Project: 48866
Buggy source:
@Test(groups={"String_Node_Str"}) public void testClusterConfig() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec.setType(ClusterType.HDFS_MAPRED);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testClusterConfig() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  spec.setType(ClusterType.HDFS_MAPRED);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  for (  NodeGroupCreate nodeGroup : spec.getNodeGroups()) {
    nodeGroup.setCpuNum(2);
    nodeGroup.setMemCapacityMB(7500);
  }
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}
Program: 48869
Project: 48869
Buggy source:
public static void setNetworkSchema(ConfigSpecImpl spec,VcCluster cluster,NetworkSchema networkSchema,VcVirtualMachine vcVm) throws Exception {
  List<VirtualDeviceSpec> changes=new ArrayList<VirtualDeviceSpec>();
  for (  NetworkSchema.Network network : networkSchema.networks) {
    VcNetwork vN=cluster.getNetwork(network.vcNetwork);
    AuAssert.check(vN != null);
    VirtualDevice nic=null;
    if (network.nicLabel != null) {
      nic=vcVm.getDeviceByLabel(network.nicLabel);
      if (nic != null) {
        changes.add(VmConfigUtil.removeDeviceSpec(nic));
      }
    }
    VirtualDeviceSpec deviceSpec=VmConfigUtil.createNetworkDevice(VmConfigUtil.EthernetControllerType.VMXNET3,network.nicLabel,vN);
    changes.add(deviceSpec);
  }
  spec.setDeviceChange(changes.toArray(new VirtualDeviceSpec[changes.size()]));
}

Fixed version (ground truth):
public static void setNetworkSchema(ConfigSpecImpl spec,VcCluster cluster,NetworkSchema networkSchema,VcVirtualMachine vcVm) throws Exception {
  List<VirtualDeviceSpec> changes=new ArrayList<VirtualDeviceSpec>();
  for (  NetworkSchema.Network network : networkSchema.networks) {
    VcNetwork vN=cluster.getNetwork(network.vcNetwork);
    if (vN == null) {
      logger.error("String_Node_Str" + network.vcNetwork + "String_Node_Str"+ cluster.getName());
      throw new Exception("String_Node_Str" + network.vcNetwork + "String_Node_Str"+ cluster.getName());
    }
    VirtualDevice nic=null;
    if (network.nicLabel != null) {
      nic=vcVm.getDeviceByLabel(network.nicLabel);
      if (nic != null) {
        changes.add(VmConfigUtil.removeDeviceSpec(nic));
      }
    }
    VirtualDeviceSpec deviceSpec=VmConfigUtil.createNetworkDevice(VmConfigUtil.EthernetControllerType.VMXNET3,network.nicLabel,vN);
    changes.add(deviceSpec);
  }
  spec.setDeviceChange(changes.toArray(new VirtualDeviceSpec[changes.size()]));
}
Program: 48870
Project: 48870
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST,consumes="String_Node_Str") @ResponseStatus(HttpStatus.ACCEPTED) public void createCluster(@RequestBody ClusterCreate createSpec,HttpServletRequest request,HttpServletResponse response) throws Exception {
  String clusterName=createSpec.getName();
  if (!CommonUtil.validateClusterName(clusterName)) {
    throw BddException.INVALID_PARAMETER("String_Node_Str",clusterName);
  }
  createSpec.validateNodeGroupNames();
  long jobExecutionId=clusterMgr.createCluster(createSpec);
  redirectRequest(jobExecutionId,request,response);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST,consumes="String_Node_Str") @ResponseStatus(HttpStatus.ACCEPTED) public void createCluster(@RequestBody ClusterCreate createSpec,HttpServletRequest request,HttpServletResponse response) throws Exception {
  String clusterName=createSpec.getName();
  if (!CommonUtil.validateClusterName(clusterName)) {
    throw BddException.INVALID_PARAMETER("String_Node_Str",clusterName);
  }
  long jobExecutionId=clusterMgr.createCluster(createSpec);
  redirectRequest(jobExecutionId,request,response);
}
Program: 48871
Project: 48871
Buggy source:
@JsonIgnore public boolean isSpecFile(){
  return specFile;
}

Fixed version (ground truth):
public Boolean isSpecFile(){
  return specFile;
}
Program: 48872
Project: 48872
Buggy source:
public void setSpecFile(boolean specFile){
  this.specFile=specFile;
}

Fixed version (ground truth):
public void setSpecFile(Boolean specFile){
  this.specFile=specFile;
}
Program: 48873
Project: 48873
Buggy source:
public ClusterCreate getClusterSpec(String clusterName){
  ClusterCreate spec=clusterConfigMgr.getClusterConfig(clusterName);
  spec.setVcClusters(null);
  spec.setTemplateId(null);
  spec.setDistroMap(null);
  spec.setSharedDatastorePattern(null);
  spec.setLocalDatastorePattern(null);
  spec.setNetworkings(null);
  spec.setRpNames(null);
  spec.setDsNames(null);
  spec.setNetworkConfig(null);
  spec.setName(null);
  spec.setDistro(null);
  spec.setValidateConfig(null);
  spec.setTopologyPolicy(null);
  spec.setHostToRackMap(null);
  spec.setHttpProxy(null);
  spec.setNoProxy(null);
  spec.setDistroVendor(null);
  spec.setDistroVersion(null);
  NodeGroupCreate[] groups=spec.getNodeGroups();
  if (groups != null) {
    for (    NodeGroupCreate group : groups) {
      group.setVcClusters(null);
      group.setGroupType(null);
      group.setRpNames(null);
      group.getStorage().setDsNames(null);
      group.getStorage().setImagestoreNamePattern(null);
      group.getStorage().setDiskstoreNamePattern(null);
      group.setVmFolderPath(null);
      group.getStorage().setSplitPolicy(null);
      group.getStorage().setControllerType(null);
      group.getStorage().setAllocType(null);
      if (group.getPlacementPolicies() != null) {
        List<GroupAssociation> associations=group.getPlacementPolicies().getGroupAssociations();
        if (associations != null && associations.isEmpty()) {
          group.getPlacementPolicies().setGroupAssociations(null);
        }
      }
    }
  }
  return spec;
}

Fixed version (ground truth):
public ClusterCreate getClusterSpec(String clusterName){
  ClusterCreate spec=clusterConfigMgr.getClusterConfig(clusterName);
  spec.setVcClusters(null);
  spec.setTemplateId(null);
  spec.setDistroMap(null);
  spec.setSharedDatastorePattern(null);
  spec.setLocalDatastorePattern(null);
  spec.setNetworkings(null);
  spec.setRpNames(null);
  spec.setDsNames(null);
  spec.setNetworkConfig(null);
  spec.setName(null);
  spec.setDistro(null);
  spec.setValidateConfig(null);
  spec.setSpecFile(null);
  spec.setTopologyPolicy(null);
  spec.setHostToRackMap(null);
  spec.setHttpProxy(null);
  spec.setNoProxy(null);
  spec.setDistroVendor(null);
  spec.setDistroVersion(null);
  NodeGroupCreate[] groups=spec.getNodeGroups();
  if (groups != null) {
    for (    NodeGroupCreate group : groups) {
      group.setVcClusters(null);
      group.setGroupType(null);
      group.setRpNames(null);
      group.getStorage().setDsNames(null);
      group.getStorage().setImagestoreNamePattern(null);
      group.getStorage().setDiskstoreNamePattern(null);
      group.setVmFolderPath(null);
      group.getStorage().setSplitPolicy(null);
      group.getStorage().setControllerType(null);
      group.getStorage().setAllocType(null);
      if (group.getPlacementPolicies() != null) {
        List<GroupAssociation> associations=group.getPlacementPolicies().getGroupAssociations();
        if (associations != null && associations.isEmpty()) {
          group.getPlacementPolicies().setGroupAssociations(null);
        }
      }
    }
  }
  return spec;
}
Program: 48874
Project: 48874
Buggy source:
public static VcProviderException MEMORY_EXCEED_LIMIT(long memory,long maxMemory,String vmName){
  return new VcProviderException(null,"String_Node_Str",memory,maxMemory,vmName);
}

Fixed version (ground truth):
public static VcProviderException MEMORY_EXCEED_LIMIT(long maxMemory,String vmName){
  return new VcProviderException(null,"String_Node_Str",maxMemory,vmName);
}
Program: 48875
Project: 48875
Buggy source:
public static VcProviderException CPU_EXCEED_LIMIT(int cpuNumber,int maxCpuNumber,String vmName){
  return new VcProviderException(null,"String_Node_Str",cpuNumber,maxCpuNumber,vmName);
}

Fixed version (ground truth):
public static VcProviderException CPU_EXCEED_LIMIT(int cpuNumber,String vmName,int maxCpuNumber){
  return new VcProviderException(null,"String_Node_Str",cpuNumber,vmName,maxCpuNumber);
}
Program: 48876
Project: 48876
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void modifyNetwork(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String name,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String ip){
  if (!validateIP(ip,Constants.OUTPUT_OP_MODIFY)) {
    return;
  }
  NetworkAdd networkAdd=new NetworkAdd();
  networkAdd.setName(name);
  try {
    networkAdd.setIp(transferIpInfo(ip));
    networkRestClient.increaseIPs(networkAdd);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_NETWORK,name,Constants.OUTPUT_OP_RESULT_MODIFY);
  }
 catch (  Exception e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_NETWORK,name,Constants.OUTPUT_OP_RESULT_MODIFY,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void modifyNetwork(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String name,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String ip){
  if (!validateIP(ip,Constants.OUTPUT_OP_MODIFY)) {
    return;
  }
  NetworkAdd networkAdd=new NetworkAdd();
  networkAdd.setName(name);
  try {
    networkAdd.setIp(transferIpInfo(ip));
    networkRestClient.increaseIPs(networkAdd);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_NETWORK,name,Constants.OUTPUT_OP_RESULT_MODIFY);
  }
 catch (  Exception e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_NETWORK,name,Constants.OUTPUT_OP_MODIFY,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}
Program: 48877
Project: 48877
Buggy source:
@Override @Transactional public synchronized NetworkEntity addDhcpNetwork(final String name,final String portGroup){
  if (!resService.isNetworkExistInVc(portGroup)) {
    throw VcProviderException.NETWORK_NOT_FOUND(portGroup);
  }
  try {
    NetworkEntity network=new NetworkEntity(name,portGroup,AllocType.DHCP,null,null,null,null);
    networkDao.insert(network);
    network.validate();
    return network;
  }
 catch (  UniqueConstraintViolationException ex) {
    logger.error("String_Node_Str");
    throw BddException.ALREADY_EXISTS(ex,"String_Node_Str",name);
  }
}

Fixed version (ground truth):
@Override @Transactional public synchronized NetworkEntity addDhcpNetwork(final String name,final String portGroup){
  validateNetworkName(name);
  if (!resService.isNetworkExistInVc(portGroup)) {
    throw VcProviderException.NETWORK_NOT_FOUND(portGroup);
  }
  try {
    NetworkEntity network=new NetworkEntity(name,portGroup,AllocType.DHCP,null,null,null,null);
    networkDao.insert(network);
    network.validate();
    return network;
  }
 catch (  UniqueConstraintViolationException ex) {
    logger.error("String_Node_Str");
    throw BddException.ALREADY_EXISTS(ex,"String_Node_Str",name);
  }
}
Program: 48878
Project: 48878
Buggy source:
@Override @Transactional public synchronized NetworkEntity addIpPoolNetwork(final String name,final String portGroup,final String netmask,final String gateway,final String dns1,final String dns2,final List<IpBlock> ipBlocks){
  try {
    if (!resService.isNetworkExistInVc(portGroup)) {
      throw VcProviderException.NETWORK_NOT_FOUND(portGroup);
    }
    NetworkEntity network=new NetworkEntity(name,portGroup,AllocType.IP_POOL,netmask,gateway,dns1,dns2);
    networkDao.insert(network);
    List<IpBlockEntity> blocks=new ArrayList<IpBlockEntity>(ipBlocks.size());
    for (    IpBlock ib : ipBlocks) {
      IpBlockEntity blk=new IpBlockEntity(null,IpBlockEntity.FREE_BLOCK_OWNER_ID,BlockType.FREE,IpAddressUtil.getAddressAsLong(ib.getBeginIp()),IpAddressUtil.getAddressAsLong(ib.getEndIp()));
      blocks.add(blk);
    }
    networkDao.addIpBlocks(network,blocks);
    network.validate();
    return network;
  }
 catch (  UniqueConstraintViolationException ex) {
    logger.error("String_Node_Str");
    throw BddException.ALREADY_EXISTS(ex,"String_Node_Str",name);
  }
}

Fixed version (ground truth):
@Override @Transactional public synchronized NetworkEntity addIpPoolNetwork(final String name,final String portGroup,final String netmask,final String gateway,final String dns1,final String dns2,final List<IpBlock> ipBlocks){
  try {
    validateNetworkName(name);
    if (!resService.isNetworkExistInVc(portGroup)) {
      throw VcProviderException.NETWORK_NOT_FOUND(portGroup);
    }
    NetworkEntity network=new NetworkEntity(name,portGroup,AllocType.IP_POOL,netmask,gateway,dns1,dns2);
    networkDao.insert(network);
    List<IpBlockEntity> blocks=new ArrayList<IpBlockEntity>(ipBlocks.size());
    for (    IpBlock ib : ipBlocks) {
      IpBlockEntity blk=new IpBlockEntity(null,IpBlockEntity.FREE_BLOCK_OWNER_ID,BlockType.FREE,IpAddressUtil.getAddressAsLong(ib.getBeginIp()),IpAddressUtil.getAddressAsLong(ib.getEndIp()));
      blocks.add(blk);
    }
    networkDao.addIpBlocks(network,blocks);
    network.validate();
    return network;
  }
 catch (  UniqueConstraintViolationException ex) {
    logger.error("String_Node_Str");
    throw BddException.ALREADY_EXISTS(ex,"String_Node_Str",name);
  }
}