nus-yam/ex-repair huggingface dataset:
Program: 49072
Project: 49072
Buggy source:
@Test public void testWhiteListHandle(){
  ValidateResult hadoopValidateResult=AppConfigValidationFactory.whiteListHandle(cluster.getNodeGroups()[0].getConfiguration());
  assertEquals(hadoopValidateResult.getType(),ValidateResult.Type.WHITE_LIST_INVALID_NAME);
  assertEquals(hadoopValidateResult.getFailureNames().get(0),"String_Node_Str");
  assertEquals(hadoopValidateResult.getFailureNames().get(1),"String_Node_Str");
  ValidateResult zookeeperValidateResult=AppConfigValidationFactory.whiteListHandle(cluster.getNodeGroups()[1].getConfiguration());
  assertEquals(zookeeperValidateResult.getType(),ValidateResult.Type.WHITE_LIST_INVALID_NAME);
  assertEquals(zookeeperValidateResult.getFailureNames().get(0),"String_Node_Str");
  ValidateResult noExistingValidateResult=AppConfigValidationFactory.whiteListHandle(cluster.getNodeGroups()[2].getConfiguration());
  assertEquals(noExistingValidateResult.getType(),ValidateResult.Type.WHITE_LIST_NO_EXIST_FILE_NAME);
  assertEquals(noExistingValidateResult.getNoExistFileNames().get("String_Node_Str").size(),3);
}

Fixed version (ground truth):
@Test public void testWhiteListHandle(){
  ValidateResult hadoopValidateResult=AppConfigValidationFactory.whiteListHandle(cluster.getNodeGroups()[0].getConfiguration());
  assertEquals(hadoopValidateResult.getType(),ValidateResult.Type.WHITE_LIST_INVALID_NAME);
  assertEquals(hadoopValidateResult.getFailureNames().get(0),"String_Node_Str");
  assertEquals(hadoopValidateResult.getFailureNames().get(1),"String_Node_Str");
  ValidateResult zookeeperValidateResult=AppConfigValidationFactory.whiteListHandle(cluster.getNodeGroups()[1].getConfiguration());
  assertEquals(zookeeperValidateResult.getType(),ValidateResult.Type.WHITE_LIST_INVALID_NAME);
  assertEquals(zookeeperValidateResult.getFailureNames().size(),1);
  assertEquals(zookeeperValidateResult.getFailureNames().get(0),"String_Node_Str");
  ValidateResult noExistingValidateResult=AppConfigValidationFactory.whiteListHandle(cluster.getNodeGroups()[2].getConfiguration());
  assertEquals(noExistingValidateResult.getType(),ValidateResult.Type.WHITE_LIST_NO_EXIST_FILE_NAME);
  assertEquals(noExistingValidateResult.getNoExistFileNames().get("String_Node_Str").size(),3);
}
Program: 49074
Project: 49074
Buggy source:
public static NetworkException NETWORK_IN_USE(){
  return new NetworkException(null,"String_Node_Str");
}

Fixed version (ground truth):
public static NetworkException NETWORK_IN_USE(List<String> clusterNames){
  return new NetworkException(null,"String_Node_Str",clusterNames);
}
Program: 49075
Project: 49075
Buggy source:
private void assertNetworkNotUsed(NetworkEntity network) throws NetworkException {
  if (!network.getClusters().isEmpty()) {
    logger.error("String_Node_Str");
    throw NetworkException.NETWORK_IN_USE();
  }
  if (ConfigInfo.isDebugEnabled()) {
    if (network.getAllocType() == AllocType.IP_POOL && network.getClusters().isEmpty()) {
      AuAssert.check(network.getTotal() == network.getFree(),"String_Node_Str" + network.getTotal() + "String_Node_Str"+ network.getFree());
    }
  }
}

Fixed version (ground truth):
private void assertNetworkNotUsed(NetworkEntity network) throws NetworkException {
  if (!network.getClusters().isEmpty()) {
    logger.error("String_Node_Str");
    List<String> clusterNames=new ArrayList<String>();
    for (    ClusterEntity entity : network.getClusters()) {
      clusterNames.add(entity.getName());
    }
    throw NetworkException.NETWORK_IN_USE(clusterNames);
  }
  if (ConfigInfo.isDebugEnabled()) {
    if (network.getAllocType() == AllocType.IP_POOL && network.getClusters().isEmpty()) {
      AuAssert.check(network.getTotal() == network.getFree(),"String_Node_Str" + network.getTotal() + "String_Node_Str"+ network.getFree());
    }
  }
}
Program: 49076
Project: 49076
Buggy source:
@Override public Void body(){
  DAL.refresh(group);
  group.setDefineInstanceNum(oldInstanceNum);
  Set<HadoopNodeEntity> toRemove=new HashSet<HadoopNodeEntity>();
  if (group.getHadoopNodes() != null) {
    for (    HadoopNodeEntity node : group.getHadoopNodes()) {
      if (ClusterCmdUtil.getIndexFromNodeName(node.getVmName()) >= oldInstanceNum) {
        logger.info("String_Node_Str" + node.getVmName());
        toRemove.add(node);
        DAL.delete(node);
      }
    }
    group.getHadoopNodes().removeAll(toRemove);
  }
  return null;
}

Fixed version (ground truth):
@Override public Void body(){
  NodeGroupEntity group=NodeGroupEntity.findNodeGroupEntityByName(cluster,nodeGroupName);
  if (group == null) {
    logger.error("String_Node_Str" + nodeGroupName + "String_Node_Str"+ clusterName+ "String_Node_Str");
    throw ClusterManagerException.NOGEGROUP_NOT_FOUND_ERROR(nodeGroupName);
  }
  group.setDefineInstanceNum(oldInstanceNum);
  Set<HadoopNodeEntity> toRemove=new HashSet<HadoopNodeEntity>();
  if (group.getHadoopNodes() != null) {
    for (    HadoopNodeEntity node : group.getHadoopNodes()) {
      if (ClusterCmdUtil.getIndexFromNodeName(node.getVmName()) >= oldInstanceNum) {
        logger.info("String_Node_Str" + node.getVmName());
        toRemove.add(node);
        DAL.delete(node);
      }
    }
    group.getHadoopNodes().removeAll(toRemove);
  }
  return null;
}
Program: 49078
Project: 49078
Buggy source:
public ClusterCreate getClusterSpec(String clusterName){
  ClusterCreate spec=clusterConfigMgr.getClusterConfig(clusterName);
  spec.setVcClusters(null);
  spec.setTemplateId(null);
  spec.setDistroMap(null);
  spec.setSharedPattern(null);
  spec.setLocalPattern(null);
  spec.setNetworking(null);
  spec.setRpNames(null);
  spec.setDsNames(null);
  spec.setNetworkName(null);
  spec.setName(null);
  spec.setDistro(null);
  spec.setValidateConfig(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().setNamePattern(null);
      group.setVmFolderPath(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.setSharedPattern(null);
  spec.setLocalPattern(null);
  spec.setNetworking(null);
  spec.setRpNames(null);
  spec.setDsNames(null);
  spec.setNetworkName(null);
  spec.setName(null);
  spec.setDistro(null);
  spec.setValidateConfig(null);
  spec.setTopologyPolicy(null);
  spec.setHostToRackMap(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().setNamePattern(null);
      group.setVmFolderPath(null);
    }
  }
  return spec;
}
Program: 49081
Project: 49081
Buggy source:
public void limitCluster(String clusterName,String nodeGroupName,int activeComputeNodeNum){
  final String path=Constants.REST_PATH_CLUSTER + "String_Node_Str" + clusterName+ "String_Node_Str"+ "String_Node_Str";
  final HttpMethod httpverb=HttpMethod.PUT;
  PrettyOutput outputCallBack=getClusterPrettyOutputCallBack(this,clusterName);
  VHMRequestBody requestBody=new VHMRequestBody();
  requestBody.setActiveComputeNodeNum(activeComputeNodeNum);
  requestBody.setNodeGroupName(nodeGroupName);
  restClient.update(requestBody,path,httpverb,outputCallBack);
}

Fixed version (ground truth):
public void limitCluster(String clusterName,String nodeGroupName,int activeComputeNodeNum){
  final String path=Constants.REST_PATH_CLUSTER + "String_Node_Str" + clusterName+ "String_Node_Str"+ "String_Node_Str";
  final HttpMethod httpverb=HttpMethod.PUT;
  VHMRequestBody requestBody=new VHMRequestBody();
  requestBody.setActiveComputeNodeNum(activeComputeNodeNum);
  requestBody.setNodeGroupName(nodeGroupName);
  restClient.update(requestBody,path,httpverb);
}
Program: 49083
Project: 49083
Buggy source:
public TaskRead(Long id,Status status,Type type,Double progress,String errorMessage,String workDir){
  this.id=id;
  this.status=status;
  this.type=type;
  this.progress=progress;
  this.errorMessage=errorMessage;
  this.workDir=workDir;
}

Fixed version (ground truth):
public TaskRead(Long id,Status status,Type type,Double progress,String errorMessage,String workDir,String progressMessage){
  this.id=id;
  this.status=status;
  this.type=type;
  this.progress=progress;
  this.errorMessage=errorMessage;
  this.workDir=workDir;
  this.progressMessage=progressMessage;
}
Program: 49084
Project: 49084
Buggy source:
public Void body(){
  ClusterEntity cluster=ClusterEntity.findClusterEntityByName(clusterName);
  AuAssert.check(cluster != null);
  cluster.setStatus(status);
  return null;
}

Fixed version (ground truth):
@Override public List<String> body(){
  List<String> clusterNames=new ArrayList<String>();
  List<ClusterEntity> clusters=DAL.findAll(ClusterEntity.class);
  for (  ClusterEntity cluster : clusters) {
    Set<String> usedDS=cluster.getUsedVcDatastores();
    if (matchDatastorePattern(patterns,usedDS)) {
      clusterNames.add(cluster.getName());
    }
  }
  return clusterNames;
}
Program: 49086
Project: 49086
Buggy source:
public void deleteDatastore(String name){
  logger.debug("String_Node_Str" + name);
  final List<VcDataStoreEntity> entities=VcDataStoreEntity.findByName(name);
  if (entities.isEmpty()) {
    throw VcProviderException.DATASTORE_NOT_FOUND(name);
  }
  List<ClusterEntity> clusters=ClusterEntity.findClusterEntityByDatastore(name);
  if (!clusters.isEmpty()) {
    List<String> clusterNames=new ArrayList<String>();
    for (    ClusterEntity cluster : clusters) {
      clusterNames.add(cluster.getName());
    }
    logger.error("String_Node_Str" + clusterNames);
    throw VcProviderException.DATASTORE_IS_REFERENCED_BY_CLUSTER(clusterNames);
  }
  DAL.inTransactionDo(new Saveable<Void>(){
    public Void body() throws VcProviderException {
      for (      VcDataStoreEntity entity : entities) {
        entity.delete();
      }
      return null;
    }
  }
);
  logger.debug("String_Node_Str" + name);
}

Fixed version (ground truth):
public void deleteDatastore(String name){
  logger.debug("String_Node_Str" + name);
  final List<VcDataStoreEntity> entities=VcDataStoreEntity.findByName(name);
  if (entities.isEmpty()) {
    throw VcProviderException.DATASTORE_NOT_FOUND(name);
  }
  final Set<String> patterns=new HashSet<String>();
  for (  VcDataStoreEntity entity : entities) {
    patterns.add(entity.getVcDatastore());
  }
  List<String> clusterNames=ClusterEntity.findClusterNamesByUsedDatastores(patterns);
  if (!clusterNames.isEmpty()) {
    logger.error("String_Node_Str" + clusterNames);
    throw VcProviderException.DATASTORE_IS_REFERENCED_BY_CLUSTER(clusterNames);
  }
  DAL.inTransactionDo(new Saveable<Void>(){
    public Void body() throws VcProviderException {
      for (      VcDataStoreEntity entity : entities) {
        entity.delete();
      }
      return null;
    }
  }
);
  logger.debug("String_Node_Str" + name);
}
Program: 49087
Project: 49087
Buggy source:
public void deleteResourcePool(final String rpName){
  logger.debug("String_Node_Str" + rpName);
  VcResourcePoolEntity entity=VcResourcePoolEntity.findByName(rpName);
  if (entity == null) {
    throw VcProviderException.RESOURCE_POOL_NOT_FOUND(rpName);
  }
  List<ClusterEntity> clusters=ClusterEntity.findClusterEntityByRP(rpName);
  if (!clusters.isEmpty()) {
    List<String> clusterNames=new ArrayList<String>();
    for (    ClusterEntity cluster : clusters) {
      clusterNames.add(cluster.getName());
    }
    logger.error("String_Node_Str" + clusterNames);
    throw VcProviderException.RESOURCE_POOL_IS_REFERENCED_BY_CLUSTER(clusterNames);
  }
  DAL.inTransactionDelete(entity);
  logger.debug("String_Node_Str" + rpName);
}

Fixed version (ground truth):
public void deleteResourcePool(final String rpName){
  logger.debug("String_Node_Str" + rpName);
  VcResourcePoolEntity entity=VcResourcePoolEntity.findByName(rpName);
  if (entity == null) {
    throw VcProviderException.RESOURCE_POOL_NOT_FOUND(rpName);
  }
  List<String> clusterNames=ClusterEntity.findClusterNamesByUsedResourcePool(rpName);
  if (!clusterNames.isEmpty()) {
    logger.error("String_Node_Str" + clusterNames);
    throw VcProviderException.RESOURCE_POOL_IS_REFERENCED_BY_CLUSTER(clusterNames);
  }
  DAL.inTransactionDelete(entity);
  logger.debug("String_Node_Str" + rpName);
}
Program: 49088
Project: 49088
Buggy source:
public static void writeProperties(Properties properties,String propertiesFilePath){
  FileOutputStream fos=null;
  try {
    fos=new FileOutputStream(propertiesFilePath);
    properties.store(fos,"String_Node_Str");
    fos.close();
  }
 catch (  IOException e) {
    System.out.println(e.getMessage());
    if (fos != null) {
      try {
        fos.close();
      }
 catch (      IOException e1) {
        System.out.println(e1.getMessage());
      }
    }
  }
}

Fixed version (ground truth):
public static void writeProperties(Properties properties,String propertiesFilePath){
  FileOutputStream fos=null;
  try {
    Properties prop=null;
    File file=new File(propertiesFilePath);
    if (file.exists()) {
      prop=new Properties();
      prop.load(new FileInputStream(propertiesFilePath));
      prop.putAll(properties);
    }
 else {
      prop=properties;
    }
    fos=new FileOutputStream(propertiesFilePath);
    prop.store(fos,"String_Node_Str");
  }
 catch (  IOException e) {
    System.out.println(e.getMessage());
  }
 finally {
    if (fos != null) {
      try {
        fos.close();
      }
 catch (      IOException e1) {
        System.out.println(e1.getMessage());
      }
    }
  }
}
Program: 49089
Project: 49089
Buggy source:
public static Properties readProperties(String propertiesFilePath){
  Properties properties=new Properties();
  FileInputStream fis=null;
  try {
    File file=new File(propertiesFilePath);
    if (!file.exists()) {
      return null;
    }
    fis=new FileInputStream(propertiesFilePath);
    properties.load(fis);
    fis.close();
    return properties;
  }
 catch (  IOException e) {
    System.out.println(e.getMessage());
    if (fis != null) {
      try {
        fis.close();
      }
 catch (      IOException e1) {
        System.out.println(e1.getMessage());
      }
    }
    return null;
  }
}

Fixed version (ground truth):
public static Properties readProperties(String propertiesFilePath){
  Properties properties=new Properties();
  FileInputStream fis=null;
  try {
    File file=new File(propertiesFilePath);
    if (!file.exists()) {
      return null;
    }
    fis=new FileInputStream(propertiesFilePath);
    properties.load(fis);
    return properties;
  }
 catch (  IOException e) {
    System.out.println(e.getMessage());
    return null;
  }
 finally {
    if (fis != null) {
      try {
        fis.close();
      }
 catch (      IOException e) {
        System.out.println(e.getMessage());
      }
    }
  }
}
Program: 49090
Project: 49090
Buggy source:
private <T>ResponseEntity<T> login(final String path,final Class<T> respEntityType,final String username,final String password){
  StringBuilder uriBuff=new StringBuilder();
  uriBuff.append(hostUri).append(path);
  if (!CommandsUtils.isBlank(username) && !CommandsUtils.isBlank(password)) {
    uriBuff.append("String_Node_Str").append("String_Node_Str").append(username).append("String_Node_Str").append(password);
  }
  return restPostByUri(uriBuff.toString(),respEntityType);
}

Fixed version (ground truth):
private <T>ResponseEntity<T> login(final String path,final Class<T> respEntityType,final String username,final String password){
  StringBuilder uriBuff=new StringBuilder();
  uriBuff.append(hostUri).append(path);
  if (!CommandsUtils.isBlank(username) && !CommandsUtils.isBlank(password)) {
    uriBuff.append("String_Node_Str").append("String_Node_Str").append(username).append("String_Node_Str").append(password);
  }
  return restPostByUri(uriBuff.toString(),respEntityType,false);
}
Program: 49091
Project: 49091
Buggy source:
private <T>ResponseEntity<T> restPostByUri(String uri,Class<T> respEntityType){
  HttpHeaders headers=buildHeaders();
  HttpEntity<String> entity=new HttpEntity<String>(headers);
  return client.exchange(uri,HttpMethod.POST,entity,respEntityType);
}

Fixed version (ground truth):
private <T>ResponseEntity<T> restPostByUri(String uri,Class<T> respEntityType,boolean withCookie){
  HttpHeaders headers=buildHeaders(withCookie);
  HttpEntity<String> entity=new HttpEntity<String>(headers);
  return client.exchange(uri,HttpMethod.POST,entity,respEntityType);
}
Program: 49092
Project: 49092
Buggy source:
private String readCookieInfo(){
  String cookieValue="String_Node_Str";
  cookieValue=CookieCache.get("String_Node_Str");
  if (CommandsUtils.isBlank(cookieValue)) {
    String propertiesFile="String_Node_Str";
    Properties properties=null;
    properties=CommandsUtils.readProperties(propertiesFile);
    if (properties != null) {
      return properties.getProperty("String_Node_Str");
    }
 else {
      return null;
    }
  }
  return cookieValue;
}

Fixed version (ground truth):
private String readCookieInfo(){
  String cookieValue="String_Node_Str";
  cookieValue=CookieCache.get("String_Node_Str");
  if (CommandsUtils.isBlank(cookieValue)) {
    Properties properties=null;
    properties=CommandsUtils.readProperties(Constants.PROPERTY_FILE);
    if (properties != null) {
      return properties.getProperty("String_Node_Str");
    }
 else {
      return null;
    }
  }
  return cookieValue;
}
Program: 49093
Project: 49093
Buggy source:
private HttpHeaders buildHeaders(){
  HttpHeaders headers=new HttpHeaders();
  headers.setContentType(MediaType.APPLICATION_JSON);
  List<MediaType> acceptedTypes=new ArrayList<MediaType>();
  acceptedTypes.add(MediaType.APPLICATION_JSON);
  acceptedTypes.add(MediaType.TEXT_HTML);
  headers.setAccept(acceptedTypes);
  String cookieInfo=readCookieInfo();
  headers.add("String_Node_Str",cookieInfo == null ? "String_Node_Str" : cookieInfo);
  return headers;
}

Fixed version (ground truth):
private HttpHeaders buildHeaders(){
  return buildHeaders(true);
}
Program: 49094
Project: 49094
Buggy source:
private void writeCookieInfo(String cookie){
  CookieCache.put("String_Node_Str",cookie);
  String propertiesFile="String_Node_Str";
  Properties properties=new Properties();
  properties.put("String_Node_Str",cookie);
  CommandsUtils.writeProperties(properties,propertiesFile);
}

Fixed version (ground truth):
private void writeCookieInfo(String cookie){
  CookieCache.put("String_Node_Str",cookie);
  Properties properties=new Properties();
  properties.put("String_Node_Str",cookie);
  CommandsUtils.writeProperties(properties,Constants.PROPERTY_FILE);
}
Program: 49095
Project: 49095
Buggy source:
@Test public void testResumeCreateClusterFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NOT_FOUND,mapper.writeValueAsString(errorMsg));
  clusterCommands.createCluster("String_Node_Str","String_Node_Str",null,null,null,null,null,null,true,false,false);
  CookieCache.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testResumeCreateClusterFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NOT_FOUND,mapper.writeValueAsString(errorMsg));
  clusterCommands.createCluster("String_Node_Str","String_Node_Str",null,null,null,null,null,null,true,false,false);
  CookieCache.clear();
}
Program: 49096
Project: 49096
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.put("String_Node_Str","String_Node_Str");
}

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",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: 49098
Project: 49098
Buggy source:
@Test public void testClusterStopFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  this.buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NOT_FOUND,mapper.writeValueAsString(errorMsg));
  clusterCommands.stopCluster("String_Node_Str");
  CookieCache.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testClusterStopFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  this.buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NOT_FOUND,mapper.writeValueAsString(errorMsg));
  clusterCommands.stopCluster("String_Node_Str");
  CookieCache.clear();
}
Program: 49099
Project: 49099
Buggy source:
@Test(enabled=false) public void testConfigCluster() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  StorageRead sr1=new StorageRead();
  sr1.setType("String_Node_Str");
  sr1.setSizeGB(100);
  NodeRead nr1=new NodeRead();
  nr1.setHostName("String_Node_Str");
  nr1.setIp("String_Node_Str");
  nr1.setName("String_Node_Str");
  nr1.setStatus("String_Node_Str");
  List<NodeRead> instances1=new LinkedList<NodeRead>();
  instances1.add(nr1);
  List<String> roles1=new LinkedList<String>();
  roles1.add(Constants.ROLE_HADOOP_NAME_NODE);
  roles1.add(Constants.ROLE_HADOOP_JOB_TRACKER);
  NodeGroupRead ngr1=new NodeGroupRead();
  ngr1.setName("String_Node_Str");
  ngr1.setCpuNum(6);
  ngr1.setMemCapacityMB(2048);
  ngr1.setStorage(sr1);
  ngr1.setInstanceNum(1);
  ngr1.setInstances(instances1);
  ngr1.setRoles(roles1);
  ClusterRead cr1=new ClusterRead();
  cr1.setName("String_Node_Str");
  cr1.setDistro("String_Node_Str");
  cr1.setInstanceNum(10);
  cr1.setStatus(ClusterRead.ClusterStatus.RUNNING);
  List<NodeGroupRead> nodeGroupRead1=new LinkedList<NodeGroupRead>();
  nodeGroupRead1.add(ngr1);
  cr1.setNodeGroups(nodeGroupRead1);
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(cr1));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.configCluster("String_Node_Str","String_Node_Str",false,false);
  CookieCache.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test(enabled=false) public void testConfigCluster() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  StorageRead sr1=new StorageRead();
  sr1.setType("String_Node_Str");
  sr1.setSizeGB(100);
  NodeRead nr1=new NodeRead();
  nr1.setHostName("String_Node_Str");
  nr1.setIp("String_Node_Str");
  nr1.setName("String_Node_Str");
  nr1.setStatus("String_Node_Str");
  List<NodeRead> instances1=new LinkedList<NodeRead>();
  instances1.add(nr1);
  List<String> roles1=new LinkedList<String>();
  roles1.add(Constants.ROLE_HADOOP_NAME_NODE);
  roles1.add(Constants.ROLE_HADOOP_JOB_TRACKER);
  NodeGroupRead ngr1=new NodeGroupRead();
  ngr1.setName("String_Node_Str");
  ngr1.setCpuNum(6);
  ngr1.setMemCapacityMB(2048);
  ngr1.setStorage(sr1);
  ngr1.setInstanceNum(1);
  ngr1.setInstances(instances1);
  ngr1.setRoles(roles1);
  ClusterRead cr1=new ClusterRead();
  cr1.setName("String_Node_Str");
  cr1.setDistro("String_Node_Str");
  cr1.setInstanceNum(10);
  cr1.setStatus(ClusterRead.ClusterStatus.RUNNING);
  List<NodeGroupRead> nodeGroupRead1=new LinkedList<NodeGroupRead>();
  nodeGroupRead1.add(ngr1);
  cr1.setNodeGroups(nodeGroupRead1);
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(cr1));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.configCluster("String_Node_Str","String_Node_Str",false,false);
  CookieCache.clear();
}
Program: 49100
Project: 49100
Buggy source:
@Test public void testClusterStop(){
  CookieCache.put("String_Node_Str","String_Node_Str");
  this.buildReqRespWithoutRespBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.stopCluster("String_Node_Str");
  CookieCache.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testClusterStop(){
  CookieCache.put("String_Node_Str","String_Node_Str");
  this.buildReqRespWithoutRespBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.stopCluster("String_Node_Str");
  CookieCache.clear();
}
Program: 49101
Project: 49101
Buggy source:
@Test public void testClusterStartFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  this.buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NOT_FOUND,mapper.writeValueAsString(errorMsg));
  clusterCommands.startCluster("String_Node_Str");
  CookieCache.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testClusterStartFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  this.buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NOT_FOUND,mapper.writeValueAsString(errorMsg));
  clusterCommands.startCluster("String_Node_Str");
  CookieCache.clear();
}
Program: 49102
Project: 49102
Buggy source:
@Test public void testResumeCreateCluster() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.createCluster("String_Node_Str",null,null,null,null,null,null,null,true,false,false);
  CookieCache.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testResumeCreateCluster() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.createCluster("String_Node_Str",null,null,null,null,null,null,null,true,false,false);
  CookieCache.clear();
}
Program: 49107
Project: 49107
Buggy source:
@Test public void testGetClusterFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.NOT_FOUND,mapper.writeValueAsString(errorMsg));
  clusterCommands.getCluster(null,true);
  CookieCache.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testGetClusterFailure() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  BddErrorMessage errorMsg=new BddErrorMessage();
  errorMsg.setMessage("String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.NOT_FOUND,mapper.writeValueAsString(errorMsg));
  clusterCommands.getCluster(null,true);
  CookieCache.clear();
}
Program: 49108
Project: 49108
Buggy source:
@Test public void testClusterStart(){
  CookieCache.put("String_Node_Str","String_Node_Str");
  this.buildReqRespWithoutRespBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.startCluster("String_Node_Str");
  CookieCache.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testClusterStart(){
  CookieCache.put("String_Node_Str","String_Node_Str");
  this.buildReqRespWithoutRespBody("String_Node_Str",HttpMethod.PUT,HttpStatus.NO_CONTENT,"String_Node_Str");
  clusterCommands.startCluster("String_Node_Str");
  CookieCache.clear();
}
Program: 49109
Project: 49109
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.put("String_Node_Str","String_Node_Str");
}

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",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: 49110
Project: 49110
Buggy source:
@Test public void testExportClusterSpec() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  ClusterCreate clusterSpec=CommandsUtils.getObjectByJsonString(ClusterCreate.class,CommandsUtils.dataFromFile(this.getClass().getResource("String_Node_Str").getPath()));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(clusterSpec));
  clusterCommands.exportClusterSpec("String_Node_Str",null);
  CookieCache.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testExportClusterSpec() throws Exception {
  CookieCache.put("String_Node_Str","String_Node_Str");
  ObjectMapper mapper=new ObjectMapper();
  ClusterCreate clusterSpec=CommandsUtils.getObjectByJsonString(ClusterCreate.class,CommandsUtils.dataFromFile(this.getClass().getResource("String_Node_Str").getPath()));
  buildReqRespWithoutReqBody("String_Node_Str",HttpMethod.GET,HttpStatus.OK,mapper.writeValueAsString(clusterSpec));
  clusterCommands.exportClusterSpec("String_Node_Str",null);
  CookieCache.clear();
}
Program: 49113
Project: 49113
Buggy source:
public void validateIfHostCanSatisfied(int instanceNum){
  if (getInstancePerHost() != null) {
    int requiredHostNum=instanceNum / getInstancePerHost();
    if (requiredHostNum > 0 && getGroupRacks() != null) {
      GroupRacks groupRacks=(GroupRacks)new Gson().fromJson(getGroupRacks(),GroupRacks.class);
      Integer totalHostNum=0;
      List<RackInfo> racksInfo=new RackInfoManager().exportRackInfo();
      Set<String> totalRacks=new HashSet<String>(Arrays.asList(groupRacks.getRacks()));
      for (      RackInfo rackInfo : racksInfo) {
        if (totalRacks.isEmpty()) {
          totalHostNum+=rackInfo.getHosts().size();
        }
 else         if (totalRacks.contains(rackInfo.getName())) {
          totalHostNum+=rackInfo.getHosts().size();
        }
      }
      if (totalHostNum < requiredHostNum) {
        throw ClusterConfigException.LACK_PHYSICAL_HOSTS();
      }
    }
  }
}

Fixed version (ground truth):
public void validateIfHostCanSatisfied(int instanceNum){
  if (getInstancePerHost() != null) {
    int requiredHostNum=instanceNum / getInstancePerHost();
    if (requiredHostNum > 0 && getGroupRacks() != null) {
      GroupRacks groupRacks=(GroupRacks)new Gson().fromJson(getGroupRacks(),GroupRacks.class);
      Integer totalHostNum=0;
      List<RackInfo> racksInfo=new RackInfoManager().exportRackInfo();
      Set<String> totalRacks=new HashSet<String>(Arrays.asList(groupRacks.getRacks()));
      for (      RackInfo rackInfo : racksInfo) {
        if (totalRacks.isEmpty()) {
          totalHostNum+=rackInfo.getHosts().size();
        }
 else         if (totalRacks.contains(rackInfo.getName())) {
          totalHostNum+=rackInfo.getHosts().size();
        }
      }
      if (totalHostNum < requiredHostNum) {
        throw ClusterConfigException.LACK_PHYSICAL_HOSTS(this.name,requiredHostNum,totalHostNum);
      }
    }
  }
}
Program: 49114
Project: 49114
Buggy source:
public static ClusterConfigException LACK_PHYSICAL_HOSTS(){
  return new ClusterConfigException(null,"String_Node_Str");
}

Fixed version (ground truth):
public static ClusterConfigException LACK_PHYSICAL_HOSTS(String groupName,int requiredHostNum,int provideHostNum){
  return new ClusterConfigException(null,"String_Node_Str",groupName,requiredHostNum,provideHostNum);
}
Program: 49116
Project: 49116
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void unlimitCluster(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String clusterName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String nodeGroupName){
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void unlimitCluster(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String clusterName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String nodeGroupName){
  try {
    int activeComputeNodeNum=-1;
    ClusterRead cluster=restClient.get(clusterName,false);
    if (cluster == null) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OP_ADJUSTMENT,null,null,Constants.OUTPUT_OP_ADJUSTMENT_FAILED,"String_Node_Str" + clusterName + "String_Node_Str");
      return;
    }
    if (!cluster.validateLimit(nodeGroupName)) {
      return;
    }
    restClient.limitCluster(clusterName,nodeGroupName,activeComputeNodeNum);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OP_ADJUSTMENT,null,Constants.OUTPUT_OP_ADJUSTMENT_SUCCEEDED);
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OP_ADJUSTMENT,null,null,Constants.OUTPUT_OP_ADJUSTMENT_FAILED,e.getMessage());
  }
}
Program: 49117
Project: 49117
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void limitCluster(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String clusterName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String nodeGroupName,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final int activeComputeNodeNum){
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void limitCluster(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String clusterName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String nodeGroupName,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final int activeComputeNodeNum){
  try {
    if (activeComputeNodeNum < 0) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OP_ADJUSTMENT,null,null,Constants.OUTPUT_OP_ADJUSTMENT_FAILED,"String_Node_Str" + activeComputeNodeNum + "String_Node_Str");
      return;
    }
    ClusterRead cluster=restClient.get(clusterName,false);
    if (cluster == null) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OP_ADJUSTMENT,null,null,Constants.OUTPUT_OP_ADJUSTMENT_FAILED,"String_Node_Str" + clusterName + "String_Node_Str");
      return;
    }
    if (!cluster.validateLimit(nodeGroupName)) {
      return;
    }
    restClient.limitCluster(clusterName,nodeGroupName,activeComputeNodeNum);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OP_ADJUSTMENT,null,Constants.OUTPUT_OP_ADJUSTMENT_SUCCEEDED);
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OP_ADJUSTMENT,null,null,Constants.OUTPUT_OP_ADJUSTMENT_FAILED,e.getMessage());
  }
}
Program: 49118
Project: 49118
Buggy source:
public boolean isRefresh() throws Exception {
  try {
    cluster=clusterRestClient.get(id,false);
    if (cluster != null) {
      List<NodeGroupRead> nodeGroups=cluster.getNodeGroups();
      if (nodeGroups != null) {
        return checkOutputUpdate(nodeGroups);
      }
    }
    return false;
  }
 catch (  CliRestException expectedException) {
    cluster=null;
    return false;
  }
catch (  Exception e) {
    throw e;
  }
}

Fixed version (ground truth):
public boolean isRefresh(boolean realTime) throws Exception {
  try {
    cluster=clusterRestClient.get(id,realTime);
    if (cluster != null) {
      List<NodeGroupRead> nodeGroups=cluster.getNodeGroups();
      if (nodeGroups != null) {
        return checkOutputUpdate(nodeGroups);
      }
    }
    return false;
  }
 catch (  CliRestException expectedException) {
    cluster=null;
    return false;
  }
catch (  Exception e) {
    throw e;
  }
}
Program: 49120
Project: 49120
Buggy source:
/** 
 * Check if the screen needs refresh or same as before
 */
boolean isRefresh() throws Exception ;

Fixed version (ground truth):
/** 
 * Check if the screen needs refresh or same as before
 */
boolean isRefresh(boolean realTime) throws Exception ;
Program: 49122
Project: 49122
Buggy source:
@SuppressWarnings("String_Node_Str") public File getWorkDir(){
  File path=null;
  Type type=getType();
  if (type.equals(type.INNER)) {
    if (getId() == null) {
      return null;
    }
    path=new File(taskRootDir,getId().toString());
    if (!path.exists()) {
      path.mkdirs();
    }
  }
 else   if (type.equals(type.VHM)) {
    path=new File(taskRootDir,serengetiLog);
    AuAssert.check(path.exists(),"String_Node_Str" + serengetiLog + "String_Node_Str");
  }
  return path;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public File getWorkDir(){
  File path=null;
  Type type=getType();
  if (type.equals(type.INNER)) {
    if (getId() == null) {
      return null;
    }
    path=new File(taskRootDir,getId().toString());
    if (!path.exists()) {
      path.mkdirs();
    }
  }
 else   if (type.equals(type.VHM)) {
    String serengetiLogPath="String_Node_Str";
    if (!CommonUtil.isBlank(taskRootDirStr)) {
      serengetiLogPath=taskRootDirStr + "String_Node_Str" + serengetiLog;
    }
 else {
      serengetiLogPath=System.getProperty("String_Node_Str") + "String_Node_Str" + serengetiLog;
    }
    logger.info("String_Node_Str" + serengetiLogPath);
    path=new File(serengetiLogPath);
    AuAssert.check(path.exists(),"String_Node_Str" + serengetiLog + "String_Node_Str");
  }
  return path;
}
Program: 49123
Project: 49123
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void limitCluster(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String clusterName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String nodeGroupName,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final int activeComputeNodeNum){
  try {
    ClusterRead cluster=restClient.get(clusterName,false);
    if (cluster == null) {
      CommandsUtils.printCmdFailure(Constants.OUTPUT_OP_ADJUSTMENT,null,null,Constants.OUTPUT_OP_ADJUSTMENT_FAILED,"String_Node_Str" + clusterName + "String_Node_Str");
      return;
    }
    if (!cluster.validateLimit(nodeGroupName)) {
      return;
    }
    restClient.limitCluster(clusterName,nodeGroupName,activeComputeNodeNum);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OP_ADJUSTMENT,null,Constants.OUTPUT_OP_ADJUSTMENT_SUCCEEDED);
  }
 catch (  CliRestException e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OP_ADJUSTMENT,null,null,Constants.OUTPUT_OP_ADJUSTMENT_FAILED,e.getMessage());
  }
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void limitCluster(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String clusterName,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String nodeGroupName,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final int activeComputeNodeNum){
}
Program: 49126
Project: 49126
Buggy source:
public TaskRead(Long id,Status status,Double progress,String errorMessage,String workDir){
  this.id=id;
  this.status=status;
  this.progress=progress;
  this.errorMessage=errorMessage;
  this.workDir=workDir;
}

Fixed version (ground truth):
public TaskRead(Long id,Status status,Type type,Double progress,String errorMessage,String workDir){
  this.id=id;
  this.status=status;
  this.type=type;
  this.progress=progress;
  this.errorMessage=errorMessage;
  this.workDir=workDir;
}
Program: 49127
Project: 49127
Buggy source:
public File getWorkDir(){
  if (getId() == null) {
    return null;
  }
  File path=new File(taskRootDir,getId().toString());
  if (!path.exists()) {
    path.mkdirs();
  }
  return path;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public File getWorkDir(){
  File path=null;
  Type type=getType();
  if (type.equals(type.INNER)) {
    if (getId() == null) {
      return null;
    }
    path=new File(taskRootDir,getId().toString());
    if (!path.exists()) {
      path.mkdirs();
    }
  }
 else   if (type.equals(type.VHM)) {
    path=new File(taskRootDir,serengetiLog);
    AuAssert.check(path.exists(),"String_Node_Str" + serengetiLog + "String_Node_Str");
  }
  return path;
}
Program: 49128
Project: 49128
Buggy source:
public TaskRead getTaskById(final Long taskId){
  TaskEntity entity=DAL.inRoTransactionDo(new Saveable<TaskEntity>(){
    @Override public TaskEntity body() throws Exception {
      return DAL.findById(TaskEntity.class,taskId);
    }
  }
);
  if (entity != null) {
    return new TaskRead(entity.getId(),entity.getStatus(),entity.getProgress(),entity.getErrorMessage(),entity.getWorkDir().getAbsolutePath());
  }
  return null;
}

Fixed version (ground truth):
public TaskRead getTaskById(final Long taskId){
  TaskEntity entity=DAL.inRoTransactionDo(new Saveable<TaskEntity>(){
    @Override public TaskEntity body() throws Exception {
      return DAL.findById(TaskEntity.class,taskId);
    }
  }
);
  if (entity != null) {
    return new TaskRead(entity.getId(),entity.getStatus(),entity.getType(),entity.getProgress(),entity.getErrorMessage(),entity.getWorkDir().getAbsolutePath());
  }
  return null;
}
Program: 49129
Project: 49129
Buggy source:
public List<TaskRead> getTasks(){
  List<TaskEntity> taskEntities=DAL.inRoTransactionDo(new Saveable<List<TaskEntity>>(){
    @Override public List<TaskEntity> body() throws Exception {
      return DAL.findAll(TaskEntity.class);
    }
  }
);
  List<TaskRead> tasks=new ArrayList<TaskRead>();
  for (  TaskEntity entity : taskEntities) {
    tasks.add(new TaskRead(entity.getId(),entity.getStatus(),entity.getProgress(),entity.getErrorMessage(),entity.getWorkDir().getAbsolutePath()));
  }
  return tasks;
}

Fixed version (ground truth):
public List<TaskRead> getTasks(){
  List<TaskEntity> taskEntities=DAL.inRoTransactionDo(new Saveable<List<TaskEntity>>(){
    @Override public List<TaskEntity> body() throws Exception {
      return DAL.findAll(TaskEntity.class);
    }
  }
);
  List<TaskRead> tasks=new ArrayList<TaskRead>();
  for (  TaskEntity entity : taskEntities) {
    tasks.add(new TaskRead(entity.getId(),entity.getStatus(),entity.getType(),entity.getProgress(),entity.getErrorMessage(),entity.getWorkDir().getAbsolutePath()));
  }
  return tasks;
}
Program: 49130
Project: 49130
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.PUT) @ResponseStatus(HttpStatus.ACCEPTED) public void limitCluster(@PathVariable("String_Node_Str") String clusterName,@RequestBody VHMRequestBody requestBody,HttpServletRequest request,HttpServletResponse response) throws Exception {
  int activeComputeNodeNum=requestBody.getActiveComputeNodeNum();
  String groupName=requestBody.getNodeGroupName();
  Long taskId=clusterMgr.limitCluster(clusterName,groupName,activeComputeNodeNum);
  redirectRequest(taskId,request,response);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.PUT) @ResponseStatus(HttpStatus.ACCEPTED) public void limitCluster(@PathVariable("String_Node_Str") String clusterName,@RequestBody VHMRequestBody requestBody,HttpServletRequest request,HttpServletResponse response) throws Exception {
  int activeComputeNodeNum=requestBody.getActiveComputeNodeNum();
  String groupName=requestBody.getNodeGroupName();
  if (activeComputeNodeNum < -1) {
    logger.error("String_Node_Str" + activeComputeNodeNum + "String_Node_Str");
    throw BddException.INVALID_PARAMETER("String_Node_Str",String.valueOf(activeComputeNodeNum));
  }
  Long taskId=clusterMgr.limitCluster(clusterName,groupName,activeComputeNodeNum);
  redirectRequest(taskId,request,response);
}