nus-yam/ex-repair huggingface dataset:
Program: 49027
Project: 49027
Buggy source:
public static void verifyNodesStatus(List<NodeEntity> nodes,NodeStatus expectedStatus,boolean ignoreMissing){
  for (  NodeEntity node : nodes) {
    if (node.getStatus() != expectedStatus) {
      if (ignoreMissing && node.getStatus() == NodeStatus.NOT_EXIST) {
        continue;
      }
      throw ClusteringServiceException.VM_STATUS_ERROR(node.getVmName(),node.getStatus().toString(),expectedStatus.toString());
    }
  }
}

Fixed version (ground truth):
public static void verifyNodesStatus(List<NodeEntity> nodes,NodeStatus expectedStatus,boolean ignoreMissing){
  for (  NodeEntity node : nodes) {
    if (node.getStatus() != expectedStatus) {
      if (ignoreMissing && node.getStatus() == NodeStatus.NOT_EXIST) {
        continue;
      }
      if (expectedStatus == NodeStatus.VM_READY) {
        VcVirtualMachine vm=VcCache.getIgnoreMissing(node.getMoId());
        if (vm != null && vm.isPoweredOn() && (VcVmUtil.getIpAddress(vm,false) != null)) {
          continue;
        }
      }
      throw ClusteringServiceException.VM_STATUS_ERROR(node.getVmName(),node.getStatus().toString(),expectedStatus.toString());
    }
  }
}
Program: 49028
Project: 49028
Buggy source:
public boolean supportedWithHdfs2(){
  if (this.getDistroVendor().equalsIgnoreCase(Constants.CDH_VENDOR)) {
    Pattern pattern=Pattern.compile(Constants.CDH4_1_PATTERN);
    if (pattern.matcher(this.getDistroVersion()).matches()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean supportedWithHdfs2(){
  if (this.getDistroVendor().equalsIgnoreCase(Constants.CDH_VENDOR)) {
    Pattern pattern=Pattern.compile(Constants.CDH4_PATTERN);
    if (pattern.matcher(this.getDistroVersion()).matches()) {
      return true;
    }
  }
  return false;
}
Program: 49029
Project: 49029
Buggy source:
@Test public void testSupportedWithHdfs2(){
  ClusterCreate cluster=new ClusterCreate();
  cluster.setDistroVendor(Constants.DEFAULT_VENDOR);
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVendor(Constants.CDH_VENDOR);
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(true,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(true,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(true,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
}

Fixed version (ground truth):
@Test public void testSupportedWithHdfs2(){
  ClusterCreate cluster=new ClusterCreate();
  cluster.setDistroVendor(Constants.DEFAULT_VENDOR);
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVendor(Constants.CDH_VENDOR);
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(true,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(true,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(true,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(true,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(true,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(true,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
  cluster.setDistroVersion("String_Node_Str");
  assertEquals(false,cluster.supportedWithHdfs2());
}
Program: 49030
Project: 49030
Buggy source:
private void updateVhmJobTrackerPort(ClusterCreate cluster,ClusterEntity clusterEntity){
  clusterEntity.setVhmJobTrackerPort("String_Node_Str");
  if (cluster.getConfiguration().containsKey("String_Node_Str")) {
    @SuppressWarnings("String_Node_Str") Map<String,Object> hadoopConfig=(Map<String,Object>)cluster.getConfiguration().get("String_Node_Str");
    if (hadoopConfig.containsKey("String_Node_Str")) {
      @SuppressWarnings("String_Node_Str") Map<String,Object> maprConfig=(Map<String,Object>)hadoopConfig.get("String_Node_Str");
      String jobtrackerAddress=(String)maprConfig.get("String_Node_Str");
      if (jobtrackerAddress != null) {
        String[] items=jobtrackerAddress.split("String_Node_Str");
        String port=items[items.length - 1];
        Pattern pattern=Pattern.compile("String_Node_Str");
        Matcher matcher=pattern.matcher(port);
        if (matcher.matches()) {
          clusterEntity.setVhmJobTrackerPort(port);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void updateVhmJobTrackerPort(ClusterCreate cluster,ClusterEntity clusterEntity){
  if (cluster.getConfiguration().containsKey("String_Node_Str")) {
    @SuppressWarnings("String_Node_Str") Map<String,Object> hadoopConfig=(Map<String,Object>)cluster.getConfiguration().get("String_Node_Str");
    if (hadoopConfig.containsKey("String_Node_Str")) {
      @SuppressWarnings("String_Node_Str") Map<String,Object> maprConfig=(Map<String,Object>)hadoopConfig.get("String_Node_Str");
      String jobtrackerAddress=(String)maprConfig.get("String_Node_Str");
      if (jobtrackerAddress != null) {
        String[] items=jobtrackerAddress.split("String_Node_Str");
        String port=items[items.length - 1];
        Pattern pattern=Pattern.compile("String_Node_Str");
        Matcher matcher=pattern.matcher(port);
        if (matcher.matches()) {
          clusterEntity.setVhmJobTrackerPort(port);
        }
      }
    }
  }
}
Program: 49035
Project: 49035
Buggy source:
@Override public void onFailure(){
  logger.debug("String_Node_Str");
  DAL.inRwTransactionDo(new Saveable<Void>(){
    @Override public Void body() throws Exception {
      ClusterEntity cluster=ClusterEntity.findClusterEntityByName(clusterName);
      AuAssert.check(cluster != null);
      cluster.setStatus(ClusterStatus.RUNNING);
      logger.error("String_Node_Str" + clusterName + "String_Node_Str");
      return null;
    }
  }
);
}

Fixed version (ground truth):
@Override public void onFailure(){
  logger.debug("String_Node_Str");
  DAL.inRwTransactionDo(new Saveable<Void>(){
    @Override public Void body() throws Exception {
      ClusterEntity cluster=ClusterEntity.findClusterEntityByName(clusterName);
      AuAssert.check(cluster != null);
      NodeGroupEntity group=NodeGroupEntity.findNodeGroupEntityByName(cluster,nodeGroupName);
      AuAssert.check(group != null);
      cluster.setStatus(ClusterStatus.RUNNING);
      group.setDefineInstanceNum(oldInstanceNum);
      logger.error("String_Node_Str" + clusterName + "String_Node_Str");
      return null;
    }
  }
);
}
Program: 49036
Project: 49036
Buggy source:
public UpdateClusterListener(String clusterName){
  super();
  this.clusterName=clusterName;
}

Fixed version (ground truth):
public UpdateClusterListener(String clusterName,String nodeGroupName,int oldInstanceNum){
  super();
  this.clusterName=clusterName;
  this.nodeGroupName=nodeGroupName;
  this.oldInstanceNum=oldInstanceNum;
}
Program: 49037
Project: 49037
Buggy source:
@Override public Void body() throws Exception {
  ClusterEntity cluster=ClusterEntity.findClusterEntityByName(clusterName);
  AuAssert.check(cluster != null);
  cluster.setStatus(ClusterStatus.RUNNING);
  logger.error("String_Node_Str" + clusterName + "String_Node_Str");
  return null;
}

Fixed version (ground truth):
@Override public Void body() throws Exception {
  ClusterEntity cluster=ClusterEntity.findClusterEntityByName(clusterName);
  AuAssert.check(cluster != null);
  NodeGroupEntity group=NodeGroupEntity.findNodeGroupEntityByName(cluster,nodeGroupName);
  AuAssert.check(group != null);
  cluster.setStatus(ClusterStatus.RUNNING);
  group.setDefineInstanceNum(oldInstanceNum);
  logger.error("String_Node_Str" + clusterName + "String_Node_Str");
  return null;
}
Program: 49039
Project: 49039
Buggy source:
@Test public void testValidateVcDataStoreNames(){
  List<String> vcDataStoreNames=new ArrayList<String>();
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(vcDataStoreNames),true);
  List<String> errorVcDataStoreNames1=new ArrayList<String>();
  errorVcDataStoreNames1.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(errorVcDataStoreNames1),false);
  List<String> errorVcDataStoreNames2=new ArrayList<String>();
  errorVcDataStoreNames2.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(errorVcDataStoreNames2),false);
}

Fixed version (ground truth):
@Test public void testValidateVcDataStoreNames(){
  List<String> vcDataStoreNames=new ArrayList<String>();
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(vcDataStoreNames),true);
  List<String> errorVcDataStoreNames1=new ArrayList<String>();
  errorVcDataStoreNames1.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(errorVcDataStoreNames1),false);
  List<String> errorVcDataStoreNames2=new ArrayList<String>();
  errorVcDataStoreNames2.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(errorVcDataStoreNames2),false);
}
Program: 49040
Project: 49040
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void getCluster(@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String name,@CliOption(key={"String_Node_Str"},mandatory=false,specifiedDefaultValue="String_Node_Str",unspecifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean detail){
  try {
    if (name == null) {
      ClusterRead[] clusters=restClient.getAll(detail);
      if (clusters != null) {
        prettyOutputClustersInfo(clusters,detail);
      }
    }
 else {
      ClusterRead cluster=restClient.get(name,detail);
      if (cluster != null) {
        prettyOutputClusterInfo(cluster,detail);
      }
    }
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_LIST,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void getCluster(@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String name,@CliOption(key={"String_Node_Str"},mandatory=false,specifiedDefaultValue="String_Node_Str",unspecifiedDefaultValue="String_Node_Str",help="String_Node_Str") final boolean detail){
  try {
    if (name == null) {
      ClusterRead[] clusters=restClient.getAll(detail);
      if (clusters != null) {
        Arrays.sort(clusters);
        prettyOutputClustersInfo(clusters,detail);
      }
    }
 else {
      ClusterRead cluster=restClient.get(name,detail);
      if (cluster != null) {
        prettyOutputClusterInfo(cluster,detail);
      }
    }
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_LIST,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}
Program: 49041
Project: 49041
Buggy source:
private void prettyOutputDistrosInfo(DistroRead[] distros){
  if (distros != null) {
    LinkedHashMap<String,List<String>> distroColumnNamesWithGetMethodNames=new LinkedHashMap<String,List<String>>();
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_NAME,Arrays.asList("String_Node_Str"));
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_VENDOR,Arrays.asList("String_Node_Str"));
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_VERSION,Arrays.asList("String_Node_Str"));
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_HVE,Arrays.asList("String_Node_Str"));
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_ROLES,Arrays.asList("String_Node_Str"));
    try {
      CommandsUtils.printInTableFormat(distroColumnNamesWithGetMethodNames,distros,Constants.OUTPUT_INDENT);
    }
 catch (    Exception e) {
      String distroName=null;
      if (distros.length == 1) {
        distroName=distros[0].getName();
      }
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_DISTRO,distroName,Constants.OUTPUT_OP_LIST,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
    }
  }
}

Fixed version (ground truth):
private void prettyOutputDistrosInfo(DistroRead[] distros){
  if (distros != null) {
    Arrays.sort(distros);
    LinkedHashMap<String,List<String>> distroColumnNamesWithGetMethodNames=new LinkedHashMap<String,List<String>>();
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_NAME,Arrays.asList("String_Node_Str"));
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_VENDOR,Arrays.asList("String_Node_Str"));
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_VERSION,Arrays.asList("String_Node_Str"));
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_HVE,Arrays.asList("String_Node_Str"));
    distroColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_ROLES,Arrays.asList("String_Node_Str"));
    try {
      CommandsUtils.printInTableFormat(distroColumnNamesWithGetMethodNames,distros,Constants.OUTPUT_INDENT);
    }
 catch (    Exception e) {
      String distroName=null;
      if (distros.length == 1) {
        distroName=distros[0].getName();
      }
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_DISTRO,distroName,Constants.OUTPUT_OP_LIST,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
    }
  }
}
Program: 49042
Project: 49042
Buggy source:
@Test public void testValidateVcDataStoreNames(){
  List<String> vcDataStoreNames=new ArrayList<String>();
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(vcDataStoreNames),true);
  List<String> errorVcDataStoreNames1=new ArrayList<String>();
  errorVcDataStoreNames1.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(errorVcDataStoreNames1),false);
  List<String> errorVcDataStoreNames2=new ArrayList<String>();
  errorVcDataStoreNames2.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(errorVcDataStoreNames2),false);
}

Fixed version (ground truth):
@Test public void testValidateVcDataStoreNames(){
  List<String> vcDataStoreNames=new ArrayList<String>();
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  vcDataStoreNames.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(vcDataStoreNames),true);
  List<String> errorVcDataStoreNames1=new ArrayList<String>();
  errorVcDataStoreNames1.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(errorVcDataStoreNames1),false);
  List<String> errorVcDataStoreNames2=new ArrayList<String>();
  errorVcDataStoreNames2.add("String_Node_Str");
  assertEquals(CommonUtil.validateVcDataStoreNames(errorVcDataStoreNames2),false);
}
Program: 49044
Project: 49044
Buggy source:
private void showFailedMsg(String name,List<String> failedMsgList){
  StringBuilder failedMsg=new StringBuilder();
  failedMsg.append(Constants.INVALID_VALUE);
  if (failedMsgList.size() > 1) {
    failedMsg.append("String_Node_Str");
  }
  failedMsg.append("String_Node_Str");
  StringBuilder tmpMsg=new StringBuilder();
  for (  String msg : failedMsgList) {
    tmpMsg.append("String_Node_Str").append(msg);
  }
  tmpMsg.replace(0,1,"String_Node_Str");
  failedMsg.append(tmpMsg);
  CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,failedMsg.toString());
}

Fixed version (ground truth):
private void showFailedMsg(String name,List<String> failedMsgList){
  StringBuilder failedMsg=new StringBuilder();
  failedMsg.append(Constants.INVALID_VALUE);
  if (failedMsgList.size() > 1) {
    failedMsg.append("String_Node_Str");
  }
  failedMsg.append("String_Node_Str");
  StringBuilder tmpMsg=new StringBuilder();
  for (  String msg : failedMsgList) {
    tmpMsg.append("String_Node_Str").append(msg);
  }
  tmpMsg.replace(0,1,"String_Node_Str");
  failedMsg.append(tmpMsg);
  failedMsg.append("String_Node_Str");
  CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,name,Constants.OUTPUT_OP_CREATE,Constants.OUTPUT_OP_RESULT_FAIL,failedMsg.toString());
}
Program: 49046
Project: 49046
Buggy source:
@Test public void testCreateClusterFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  DistroRead[] distros=new DistroRead[1];
  DistroRead distro=new DistroRead();
  distro.setName(Constants.DEFAULT_DISTRO);
  distros[0]=distro;
  NetworkRead[] networks=new NetworkRead[1];
  NetworkRead network=new NetworkRead();
  network.setName("String_Node_Str");
  network.setDhcp(true);
  network.setPortGroup("String_Node_Str");
  networks[0]=network;
  ObjectMapper mapper=new ObjectMapper();
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(distros));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(networks));
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.POST,HttpStatus.BAD_REQUEST,mapper.writeValueAsString(errorMsg));
  clusterCommands.createCluster("String_Node_Str","String_Node_Str",null,null,null,null,null,null,false,false,false);
  CookieCache.clear();
}

Fixed version (ground truth):
@Test public void testCreateClusterFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  DistroRead[] distros=new DistroRead[1];
  DistroRead distro=new DistroRead();
  distro.setName(Constants.DEFAULT_DISTRO);
  distros[0]=distro;
  NetworkRead[] networks=new NetworkRead[1];
  NetworkRead network=new NetworkRead();
  network.setName("String_Node_Str");
  network.setDhcp(true);
  network.setPortGroup("String_Node_Str");
  networks[0]=network;
  ObjectMapper mapper=new ObjectMapper();
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(distros));
  buildReqRespWithoutReqBody("String_Node_Str" + distro.getName(),HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(distro));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(networks));
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.POST,HttpStatus.BAD_REQUEST,mapper.writeValueAsString(errorMsg));
  clusterCommands.createCluster("String_Node_Str","String_Node_Str",null,null,null,null,null,null,false,false,false);
  CookieCache.clear();
}
Program: 49049
Project: 49049
Buggy source:
@Test public void testCreateCluster() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  DistroRead[] distros=new DistroRead[1];
  DistroRead distro=new DistroRead();
  distro.setName(Constants.DEFAULT_DISTRO);
  distros[0]=distro;
  NetworkRead[] networks=new NetworkRead[1];
  NetworkRead network=new NetworkRead();
  network.setName("String_Node_Str");
  network.setDhcp(true);
  network.setPortGroup("String_Node_Str");
  networks[0]=network;
  ObjectMapper mapper=new ObjectMapper();
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(distros));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(networks));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.POST,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.createCluster("String_Node_Str","String_Node_Str",null,null,null,null,null,null,false,false,false);
  CookieCache.clear();
}

Fixed version (ground truth):
@Test public void testCreateCluster() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  DistroRead[] distros=new DistroRead[1];
  DistroRead distro=new DistroRead();
  distro.setName(Constants.DEFAULT_DISTRO);
  distros[0]=distro;
  NetworkRead[] networks=new NetworkRead[1];
  NetworkRead network=new NetworkRead();
  network.setName("String_Node_Str");
  network.setDhcp(true);
  network.setPortGroup("String_Node_Str");
  networks[0]=network;
  ObjectMapper mapper=new ObjectMapper();
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(distros));
  buildReqRespWithoutReqBody("String_Node_Str" + distro.getName(),HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(distro));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(networks));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.POST,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.createCluster("String_Node_Str","String_Node_Str",null,null,null,null,null,null,false,false,false);
  CookieCache.clear();
}
Program: 49051
Project: 49051
Buggy source:
public Long createCluster(ClusterCreate createSpec) throws Exception {
  if (CommonUtil.isBlank(createSpec.getDistro())) {
    setDefaultDistro(createSpec);
  }
  setVendorInfo(createSpec);
  createSpec=ClusterSpecFactory.getCustomizedSpec(createSpec);
  String name=createSpec.getName();
  logger.info("String_Node_Str" + name);
  final ClusterEntity cluster=clusterConfigMgr.createClusterConfig(createSpec);
  CreateClusterListener listener=new CreateClusterListener(name);
  try {
    return createClusterMgmtTaskWithErrorSetting(cluster,listener,ClusterStatus.PROVISIONING);
  }
 catch (  BddException e) {
    logger.error("String_Node_Str",e);
    DAL.inTransactionDo(new Saveable<Void>(){
      public Void body() throws Exception {
        NetworkEntity network=cluster.getNetwork();
        DAL.refresh(network);
        if (network.getAllocType() == AllocType.IP_POOL) {
          networkManager.free(network,cluster.getId());
        }
        cluster.delete();
        return null;
      }
    }
);
    throw e;
  }
}

Fixed version (ground truth):
public Long createCluster(ClusterCreate createSpec) throws Exception {
  if (CommonUtil.isBlank(createSpec.getDistro())) {
    setDefaultDistro(createSpec);
  }
  DistroRead distroRead=this.getDistroManager().getDistroByName(createSpec.getDistro());
  createSpec.setVendor(distroRead.getVendor());
  createSpec.setVersion(distroRead.getVersion());
  createSpec=ClusterSpecFactory.getCustomizedSpec(createSpec);
  String name=createSpec.getName();
  logger.info("String_Node_Str" + name);
  final ClusterEntity cluster=clusterConfigMgr.createClusterConfig(createSpec);
  CreateClusterListener listener=new CreateClusterListener(name);
  try {
    return createClusterMgmtTaskWithErrorSetting(cluster,listener,ClusterStatus.PROVISIONING);
  }
 catch (  BddException e) {
    logger.error("String_Node_Str",e);
    DAL.inTransactionDo(new Saveable<Void>(){
      public Void body() throws Exception {
        NetworkEntity network=cluster.getNetwork();
        DAL.refresh(network);
        if (network.getAllocType() == AllocType.IP_POOL) {
          networkManager.free(network,cluster.getId());
        }
        cluster.delete();
        return null;
      }
    }
);
    throw e;
  }
}
Program: 49052
Project: 49052
Buggy source:
public DistroRead convert(){
  DistroRead dr=new DistroRead();
  Set<String> roles=new TreeSet<String>();
  if (this.getPackages() == null) {
    return null;
  }
  for (  RolePackageMapping pkg : this.getPackages()) {
    if (pkg.getRoles() == null) {
      return null;
    }
    for (    String r : pkg.getRoles()) {
      if (r == null || r.isEmpty()) {
        return null;
      }
      if (!roles.contains(r)) {
        roles.add(r);
      }
 else {
        logger.error("String_Node_Str" + r);
      }
    }
  }
  dr.setName(this.getName());
  dr.setVendor(this.getVendor());
  dr.setHveSupported(this.getHveSupported() == null ? false : this.getHveSupported());
  dr.setRoles(new ArrayList<String>(roles));
  return dr;
}

Fixed version (ground truth):
public DistroRead convert(){
  DistroRead dr=new DistroRead();
  Set<String> roles=new TreeSet<String>();
  if (this.getPackages() == null) {
    return null;
  }
  for (  RolePackageMapping pkg : this.getPackages()) {
    if (pkg.getRoles() == null) {
      return null;
    }
    for (    String r : pkg.getRoles()) {
      if (r == null || r.isEmpty()) {
        return null;
      }
      if (!roles.contains(r)) {
        roles.add(r);
      }
 else {
        logger.error("String_Node_Str" + r);
      }
    }
  }
  dr.setName(this.getName());
  dr.setVendor(this.getVendor());
  dr.setVersion(this.getVersion());
  dr.setHveSupported(this.getHveSupported() == null ? false : this.getHveSupported());
  dr.setRoles(new ArrayList<String>(roles));
  return dr;
}
Program: 49053
Project: 49053
Buggy source:
/** 
 * There are two approach to create a cluster: 1) specify a cluster type and optionally overwriting the parameters 2) specify a customized spec with cluster type not specified
 * @param spec spec with customized field
 * @return customized cluster spec
 * @throws FileNotFoundException
 */
public static ClusterCreate getCustomizedSpec(ClusterCreate spec) throws FileNotFoundException {
  if (spec.getType() == null) {
    return spec;
  }
  ClusterCreate newSpec=createDefaultSpec(spec.getType(),spec.getVendor());
  if (spec.getName() != null) {
    newSpec.setName(spec.getName());
  }
  if (spec.getDistro() != null) {
    newSpec.setDistro(spec.getDistro());
  }
  if (spec.getVendor() != null) {
    newSpec.setVendor(spec.getVendor());
  }
  if (spec.getDsNames() != null) {
    newSpec.setDsNames(spec.getDsNames());
  }
  if (spec.getRpNames() != null) {
    newSpec.setRpNames(spec.getRpNames());
  }
  if (spec.getNetworkName() != null) {
    newSpec.setNetworkName(spec.getNetworkName());
  }
  if (spec.getTopologyPolicy() != null) {
    newSpec.setTopologyPolicy(spec.getTopologyPolicy());
  }
  return newSpec;
}

Fixed version (ground truth):
/** 
 * There are two approach to create a cluster: 1) specify a cluster type and optionally overwriting the parameters 2) specify a customized spec with cluster type not specified
 * @param spec spec with customized field
 * @return customized cluster spec
 * @throws FileNotFoundException
 */
public static ClusterCreate getCustomizedSpec(ClusterCreate spec) throws FileNotFoundException {
  if (spec.getType() == null) {
    return spec;
  }
  ClusterCreate newSpec=createDefaultSpec(spec.getType(),spec.getVendor());
  if (spec.getName() != null) {
    newSpec.setName(spec.getName());
  }
  if (spec.getDistro() != null) {
    newSpec.setDistro(spec.getDistro());
  }
  if (spec.getVendor() != null) {
    newSpec.setVendor(spec.getVendor());
  }
  if (spec.getVersion() != null) {
    newSpec.setVersion(spec.getVersion());
  }
  if (spec.getDsNames() != null) {
    newSpec.setDsNames(spec.getDsNames());
  }
  if (spec.getRpNames() != null) {
    newSpec.setRpNames(spec.getRpNames());
  }
  if (spec.getNetworkName() != null) {
    newSpec.setNetworkName(spec.getNetworkName());
  }
  if (spec.getTopologyPolicy() != null) {
    newSpec.setTopologyPolicy(spec.getTopologyPolicy());
  }
  return newSpec;
}
Program: 49054
Project: 49054
Buggy source:
@Test public void testValidateNodeGroupName(){
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
}

Fixed version (ground truth):
@Test public void testValidateNodeGroupName(){
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
}
Program: 49056
Project: 49056
Buggy source:
public List<DistroRead> getDistros(){
  loadManifest(false);
  List<DistroRead> drs=new ArrayList<DistroRead>();
  String vendorStr=Configuration.getStrings(VENDOR,"String_Node_Str");
  vendorStr=vendorStr.toLowerCase();
  List<String> vendors=Arrays.asList(vendorStr.indexOf("String_Node_Str") != -1 ? vendorStr.split("String_Node_Str") : new String[]{vendorStr});
  List<String> errorVendors=new ArrayList<String>();
  for (  Distro distro : distros.values()) {
    DistroRead dr=distro.convert();
    if (!vendors.contains(dr.getVendor().toLowerCase())) {
      errorVendors.add(dr.getVendor());
    }
    if (dr != null) {
      drs.add(dr);
    }
 else {
      logger.error("String_Node_Str" + distro);
    }
  }
  StringBuffer errorMsg=new StringBuffer();
  if (!errorVendors.isEmpty()) {
    String errorVendorsStr=errorVendors.toString().substring(1,errorVendors.toString().length() - 1);
    errorMsg.append(errorVendorsStr).append("String_Node_Str");
  }
  if (errorMsg.length() > 0) {
    throw BddException.INTERNAL(null,errorMsg.toString());
  }
  return drs;
}

Fixed version (ground truth):
public List<DistroRead> getDistros(){
  loadManifest(false);
  List<DistroRead> drs=new ArrayList<DistroRead>();
  String vendorStr=Configuration.getStrings(VENDOR,"String_Node_Str");
  String vendorStrTmp=vendorStr.toLowerCase();
  List<String> vendors=Arrays.asList(vendorStrTmp.indexOf("String_Node_Str") != -1 ? vendorStrTmp.split("String_Node_Str") : new String[]{vendorStrTmp});
  List<String> errorVendors=new ArrayList<String>();
  for (  Distro distro : distros.values()) {
    DistroRead dr=distro.convert();
    if (!vendors.contains(dr.getVendor().toLowerCase())) {
      if (!errorVendors.contains(dr.getVendor())) {
        errorVendors.add(dr.getVendor());
      }
    }
    if (dr != null) {
      drs.add(dr);
    }
 else {
      logger.error("String_Node_Str" + distro);
    }
  }
  StringBuffer errorMsg=new StringBuffer();
  if (!errorVendors.isEmpty()) {
    errorMsg.append("String_Node_Str").append(vendorStr).append("String_Node_Str");
    String errorVendorsStr=errorVendors.toString();
    errorMsg.append("String_Node_Str").append(errorVendorsStr).append("String_Node_Str" + "String_Node_Str");
  }
  if (errorMsg.length() > 0) {
    throw BddException.INTERNAL(null,errorMsg.toString());
  }
  return drs;
}
Program: 49057
Project: 49057
Buggy source:
private void updateHostproperty(final String host) throws IOException {
  FileOutputStream hostFile=null;
  try {
    Properties hostProperty=new Properties();
    hostProperty.setProperty(Constants.PROPERTY_HOST,host);
    hostFile=new FileOutputStream(Constants.PROPERTY_FILE);
    hostProperty.store(hostFile,Constants.PROPERTY_FILE_HOST_COMMENT);
  }
 catch (  IOException e) {
    throw new IOException(Constants.PROPERTY_FILE_HOST_FAILURE);
  }
 finally {
    if (hostFile != null) {
      try {
        hostFile.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void updateHostproperty(final String host) throws IOException {
  FileOutputStream hostFile=null;
  try {
    Properties hostProperty=new Properties();
    hostProperty.setProperty(Constants.PROPERTY_HOST,host);
    hostFile=new FileOutputStream(Constants.PROPERTY_FILE);
    hostProperty.store(hostFile,Constants.PROPERTY_FILE_HOST_COMMENT);
  }
 catch (  IOException e) {
    StringBuilder exceptionMsg=new StringBuilder();
    exceptionMsg.append(Constants.PROPERTY_FILE_HOST_FAILURE);
    if (!CommonUtil.isBlank(e.getMessage())) {
      exceptionMsg.append("String_Node_Str").append(e.getMessage());
    }
    throw new IOException(exceptionMsg.toString());
  }
 finally {
    if (hostFile != null) {
      try {
        hostFile.close();
      }
 catch (      IOException e) {
      }
    }
  }
}
Program: 49059
Project: 49059
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void addDatastore(@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 spec,@CliOption(key={"String_Node_Str"},mandatory=false,unspecifiedDefaultValue="String_Node_Str",help="String_Node_Str" + "String_Node_Str") final String type){
  try {
    DatastoreAdd datastoreAdd=new DatastoreAdd();
    datastoreAdd.setName(name);
    if (CommandsUtils.inputsConvert(spec).isEmpty()) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_DATASTORE,name,Constants.OUTPUT_OP_ADD,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INPUT_SPEC_PARAM + Constants.MULTI_INPUTS_CHECK);
    }
 else {
      datastoreAdd.setSpec(CommandsUtils.inputsConvert(spec));
      datastoreAdd.setType(DatastoreType.valueOf(type));
      restClient.add(datastoreAdd);
      CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_DATASTORE,name,Constants.OUTPUT_OP_RESULT_ADD);
    }
  }
 catch (  IllegalArgumentException ex) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_DATASTORE,name,Constants.OUTPUT_OP_ADD,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INVALID_VALUE + "String_Node_Str" + "String_Node_Str"+ type);
  }
catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_DATASTORE,name,Constants.OUTPUT_OP_ADD,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void addDatastore(@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 spec,@CliOption(key={"String_Node_Str"},mandatory=false,unspecifiedDefaultValue="String_Node_Str",help="String_Node_Str" + "String_Node_Str") final String type){
  try {
    DatastoreAdd datastoreAdd=new DatastoreAdd();
    datastoreAdd.setName(name);
    if (CommandsUtils.inputsConvert(spec).isEmpty()) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_DATASTORE,name,Constants.OUTPUT_OP_ADD,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INPUT_SPEC_PARAM + Constants.MULTI_INPUTS_CHECK);
    }
 else {
      datastoreAdd.setSpec(CommandsUtils.inputsConvert(spec));
      datastoreAdd.setType(DatastoreType.valueOf(type.toUpperCase()));
      restClient.add(datastoreAdd);
      CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_DATASTORE,name,Constants.OUTPUT_OP_RESULT_ADD);
    }
  }
 catch (  IllegalArgumentException ex) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_DATASTORE,name,Constants.OUTPUT_OP_ADD,Constants.OUTPUT_OP_RESULT_FAIL,Constants.INVALID_VALUE + "String_Node_Str" + "String_Node_Str"+ type);
  }
catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_DATASTORE,name,Constants.OUTPUT_OP_ADD,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}
Program: 49061
Project: 49061
Buggy source:
private void transformHDFSUrl(ClusterCreate cluster){
  if (cluster.hasHDFSUrlConfigured()) {
    if (cluster.validateHDFSUrl()) {
      Map<String,Object> conf=cluster.getConfiguration();
      if (conf == null) {
        conf=new HashMap<String,Object>();
        cluster.setConfiguration(conf);
      }
      @SuppressWarnings("String_Node_Str") Map<String,Object> hadoopConf=(Map<String,Object>)conf.get("String_Node_Str");
      if (hadoopConf == null) {
        hadoopConf=new HashMap<String,Object>();
        conf.put("String_Node_Str",hadoopConf);
      }
      @SuppressWarnings("String_Node_Str") Map<String,Object> coreSiteConf=(Map<String,Object>)hadoopConf.get("String_Node_Str");
      if (coreSiteConf == null) {
        coreSiteConf=new HashMap<String,Object>();
        hadoopConf.put("String_Node_Str",coreSiteConf);
      }
      coreSiteConf.put("String_Node_Str",cluster.getExternalHDFS());
    }
 else {
      throw BddException.INVALID_PARAMETER("String_Node_Str",cluster.getExternalHDFS());
    }
  }
}

Fixed version (ground truth):
private void transformHDFSUrl(ClusterCreate cluster){
  if (cluster.hasHDFSUrlConfigured()) {
    if (cluster.validateHDFSUrl()) {
      changeNodeGroupHDFSUrl(cluster.getNodeGroups(),cluster.getExternalHDFS());
      changeClusterHDFSUrl(cluster);
    }
 else {
      throw BddException.INVALID_PARAMETER("String_Node_Str",cluster.getExternalHDFS());
    }
  }
}
Program: 49063
Project: 49063
Buggy source:
@Test public void testValidateClusterName(){
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
}

Fixed version (ground truth):
@Test public void testValidateClusterName(){
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
}
Program: 49064
Project: 49064
Buggy source:
@Test public void testValidateNodeGroupName(){
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateClusterName("String_Node_Str"),false);
}

Fixed version (ground truth):
@Test public void testValidateNodeGroupName(){
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),false);
  assertEquals(CommonUtil.validateNodeGroupName("String_Node_Str"),true);
}
Program: 49065
Project: 49065
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 {
  Long taskId=clusterMgr.createCluster(createSpec);
  redirectRequest(taskId,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 taskId=clusterMgr.createCluster(createSpec);
  redirectRequest(taskId,request,response);
}
Program: 49066
Project: 49066
Buggy source:
private boolean connect(final String hostName,final Map<String,String> loginInfo,int count) throws Exception {
  if (count <= 0) {
    return false;
  }
 else {
    ConnectType connectType=conn.connect(hostName,loginInfo.get("String_Node_Str"),loginInfo.get("String_Node_Str"));
    if (connectType == ConnectType.UNAUTHORIZATION) {
      if (!prompt(Constants.CONNECT_ENTER_PASSWORD,PromptType.PASSWORD,loginInfo)) {
        return false;
      }
 else {
        count--;
        connect(hostName,loginInfo,count);
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean connect(final String hostName,final Map<String,String> loginInfo,int count) throws Exception {
  if (count < 0) {
    return false;
  }
  ConnectType connectType=conn.connect(hostName,loginInfo.get("String_Node_Str"),loginInfo.get("String_Node_Str"));
  if (connectType == ConnectType.UNAUTHORIZATION) {
    if (count == 0) {
      return false;
    }
    if (!prompt(Constants.CONNECT_ENTER_PASSWORD,PromptType.PASSWORD,loginInfo)) {
      return false;
    }
 else {
      count--;
      connect(hostName,loginInfo,count);
    }
  }
  return true;
}
Program: 49068
Project: 49068
Buggy source:
private boolean checkNodeGroupRoles(NodeGroupCreate nodeGroup,List<String> distroRoles,List<String> failedMsgList){
  List<String> roles=nodeGroup.getRoles();
  boolean validated=true;
  StringBuilder rolesMsg=new StringBuilder();
  for (  String role : roles) {
    if (!distroRoles.contains(role)) {
      validated=false;
      rolesMsg.append("String_Node_Str").append(role);
    }
  }
  if (!validated) {
    rolesMsg.replace(0,1,"String_Node_Str");
    failedMsgList.add(new StringBuilder().append(nodeGroup.getName()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(rolesMsg.toString()).append("String_Node_Str").toString());
  }
  return validated;
}

Fixed version (ground truth):
private boolean checkNodeGroupRoles(NodeGroupCreate nodeGroup,List<String> distroRoles,List<String> failedMsgList){
  List<String> roles=nodeGroup.getRoles();
  boolean validated=true;
  StringBuilder rolesMsg=new StringBuilder();
  if (roles != null) {
    for (    String role : roles) {
      if (!distroRoles.contains(role)) {
        validated=false;
        rolesMsg.append("String_Node_Str").append(role);
      }
    }
  }
  if (!validated) {
    rolesMsg.replace(0,1,"String_Node_Str");
    failedMsgList.add(new StringBuilder().append(nodeGroup.getName()).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(rolesMsg.toString()).append("String_Node_Str").toString());
  }
  return validated;
}
Program: 49070
Project: 49070
Buggy source:
private List<NodeGroupRole> getNodeGroupRoles(NodeGroupCreate nodeGroupCreate){
  List<NodeGroupRole> groupRoles=new ArrayList<NodeGroupRole>();
  List<String> roles=nodeGroupCreate.getRoles();
  for (  NodeGroupRole role : NodeGroupRole.values()) {
    if (matchRole(role,roles)) {
      groupRoles.add(role);
    }
  }
  if (groupRoles.size() == 0) {
    groupRoles.add(NodeGroupRole.NONE);
  }
  return groupRoles;
}

Fixed version (ground truth):
private List<NodeGroupRole> getNodeGroupRoles(NodeGroupCreate nodeGroupCreate){
  List<NodeGroupRole> groupRoles=new ArrayList<NodeGroupRole>();
  List<String> roles=nodeGroupCreate.getRoles();
  for (  NodeGroupRole role : NodeGroupRole.values()) {
    if (roles != null && matchRole(role,roles)) {
      groupRoles.add(role);
    }
  }
  if (groupRoles.size() == 0) {
    groupRoles.add(NodeGroupRole.NONE);
  }
  return groupRoles;
}
Program: 49071
Project: 49071
Buggy source:
@SuppressWarnings("String_Node_Str") private static <T>void validateBySameFileName(final String fileName,Object configProperties,Map<String,List<T>> listFileMap,ValidateResult validateResult,ValidationType validationType){
  if (configProperties instanceof Map) {
    Map<String,Object> configPropertyMap=(Map<String,Object>)configProperties;
    List<String> removeList=new ArrayList<String>();
    for (    Entry<String,Object> configProperty : configPropertyMap.entrySet()) {
      for (      Entry<String,List<T>> listFileEntry : listFileMap.entrySet()) {
        if (listFileEntry.getValue() instanceof List) {
          List<T> propertiesPerListFile=(List<T>)listFileEntry.getValue();
          if (validationType == ValidationType.BLACK_LIST) {
            validateBlackListPropertis(fileName,propertiesPerListFile,configProperty.getKey(),validateResult,removeList);
          }
 else           if (validationType == ValidationType.WHITE_LIST) {
            validateWhiteListPropertis(propertiesPerListFile,configProperty.getKey(),String.valueOf(configProperty.getValue()),validateResult);
          }
        }
      }
    }
    for (    String pName : removeList) {
      configPropertyMap.remove(pName);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static <T>void validateBySameFileName(final String fileName,Object configProperties,Map<String,List<T>> listFileMap,ValidateResult validateResult,ValidationType validationType){
  if (configProperties instanceof Map) {
    Map<String,Object> configPropertyMap=(Map<String,Object>)configProperties;
    List<String> removeList=new ArrayList<String>();
    for (    Entry<String,Object> configProperty : configPropertyMap.entrySet()) {
      for (      Entry<String,List<T>> listFileEntry : listFileMap.entrySet()) {
        if (listFileEntry.getKey().equals(fileName) && listFileEntry.getValue() instanceof List) {
          List<T> propertiesPerListFile=(List<T>)listFileEntry.getValue();
          if (validationType == ValidationType.BLACK_LIST) {
            validateBlackListPropertis(fileName,propertiesPerListFile,configProperty.getKey(),validateResult,removeList);
          }
 else           if (validationType == ValidationType.WHITE_LIST) {
            validateWhiteListPropertis(propertiesPerListFile,configProperty.getKey(),String.valueOf(configProperty.getValue()),validateResult);
          }
        }
      }
    }
    for (    String pName : removeList) {
      configPropertyMap.remove(pName);
    }
  }
}