nus-yam/ex-repair huggingface dataset:
Program: 48274
Project: 48274
Buggy source:
@Override @Transactional public synchronized void refreshNodeTemplates(){
  long curTime=System.currentTimeMillis() / 1000;
  if (curTime - this.lastRefreshTimestamp < getRefreshNodeTemplateInterval()) {
    return;
  }
  logger.info("String_Node_Str");
  List<VcVirtualMachine> vms=VcResourceUtils.findAllNodeTemplates();
  HashSet<String> moids=new HashSet<String>();
  for (  VcVirtualMachine vm : vms) {
    String moid=vm.getId();
    moids.add(moid);
    long timestamp=System.currentTimeMillis();
    NodeTemplateEntity entity=nodeTemplateDAO.findByMoid(moid);
    if (entity == null) {
      entity=new NodeTemplateEntity();
      convertVirtualMachineToEntity(vm,entity,timestamp);
      nodeTemplateDAO.insert(entity);
    }
 else {
      convertVirtualMachineToEntity(vm,entity,timestamp);
      nodeTemplateDAO.update(entity);
    }
  }
  for (  NodeTemplateEntity entity : nodeTemplateDAO.findAll()) {
    if (!moids.contains(entity.getMoid())) {
      nodeTemplateDAO.delete(entity);
    }
  }
  logger.info("String_Node_Str");
  this.lastRefreshTimestamp=System.currentTimeMillis() / 1000;
}

Fixed version (ground truth):
@Override @Transactional public synchronized void refreshNodeTemplates(){
  long curTime=System.currentTimeMillis() / 1000;
  if (curTime - this.lastRefreshTimestamp < getRefreshNodeTemplateInterval()) {
    return;
  }
  logger.info("String_Node_Str");
  List<VcVirtualMachine> vms=VcResourceUtils.findAllNodeTemplates();
  HashSet<String> moids=new HashSet<String>();
  HashMap<String,String> nameToMoid=new HashMap<String,String>();
  for (  VcVirtualMachine vm : vms) {
    String moid=vm.getId();
    moids.add(moid);
    nameToMoid.put(vm.getName(),moid);
    long timestamp=System.currentTimeMillis();
    NodeTemplateEntity entity=nodeTemplateDAO.findByMoid(moid);
    if (entity == null) {
      entity=new NodeTemplateEntity();
      convertVirtualMachineToEntity(vm,entity,timestamp);
      nodeTemplateDAO.insert(entity);
    }
 else {
      convertVirtualMachineToEntity(vm,entity,timestamp);
      nodeTemplateDAO.update(entity);
    }
  }
  for (  NodeTemplateEntity entity : nodeTemplateDAO.findAll()) {
    if (!moids.contains(entity.getMoid())) {
      if (ConfigInfo.isJustRestored()) {
        logger.info("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        String oldMoid=entity.getMoid();
        String newMoid=nameToMoid.get(entity.getName());
        if (null != newMoid) {
          templateMoidMap.put(oldMoid,newMoid);
        }
      }
      nodeTemplateDAO.delete(entity);
    }
  }
  logger.info("String_Node_Str");
  this.lastRefreshTimestamp=System.currentTimeMillis() / 1000;
}
Program: 48276
Project: 48276
Buggy source:
private void retry(int retryTimes,Retriable operate) throws Exception {
  int i=0;
  while (true) {
    i+=1;
    try {
      operate.doWork();
      return;
    }
 catch (    Exception e) {
      if (i == retryTimes) {
        logger.info("String_Node_Str" + retryTimes + "String_Node_Str");
        throw e;
      }
 else {
        logger.info("String_Node_Str" + i + "String_Node_Str"+ e.getMessage()+ "String_Node_Str"+ (retryTimes - i)+ "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
private void retry(int retryTimes,int sleepTime,Retriable operate) throws Exception {
  int i=0;
  while (true) {
    i+=1;
    Thread.sleep(sleepTime * 1000);
    try {
      operate.doWork();
      return;
    }
 catch (    Exception e) {
      if (i == retryTimes) {
        logger.info("String_Node_Str" + retryTimes + "String_Node_Str");
        throw e;
      }
 else {
        logger.info("String_Node_Str" + i + "String_Node_Str"+ e.getMessage()+ "String_Node_Str"+ (retryTimes - i)+ "String_Node_Str");
      }
    }
  }
}
Program: 48278
Project: 48278
Buggy source:
/** 
 * @param vcResourceFilters refresh the vc inventory, some resource will be filtered from refreshing.
 */
public void refreshInventory(VcResourceFilters vcResourceFilters) throws InterruptedException {
  if (inProgress.get()) {
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("String_Node_Str");
    }
    waitForCompletion();
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("String_Node_Str");
    }
  }
 else {
    if (inProgress.compareAndSet(false,true)) {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("String_Node_Str");
      }
      counters.setRefreshInProgress(true);
      counters.increaseInvRefresh();
      try {
        List<VcDatacenter> dcList=VcInventory.getDatacenters();
        refresh(dcList,vcResourceFilters);
      }
  finally {
        counters.setRefreshInProgress(false);
        inProgress.set(false);
        if (LOGGER.isInfoEnabled()) {
          LOGGER.info("String_Node_Str");
        }
      }
    }
 else {
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("String_Node_Str");
      }
      waitForCompletion();
      if (LOGGER.isInfoEnabled()) {
        LOGGER.info("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param vcResourceFilters refresh the vc inventory, some resource will be filtered from refreshing.
 */
public synchronized void refreshInventory(VcResourceFilters vcResourceFilters) throws InterruptedException {
  inProgress.set(true);
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("String_Node_Str");
  }
  counters.setRefreshInProgress(true);
  counters.increaseInvRefresh();
  try {
    List<VcDatacenter> dcList=VcInventory.getDatacenters();
    refresh(dcList,vcResourceFilters);
  }
  finally {
    counters.setRefreshInProgress(false);
    inProgress.set(false);
    if (LOGGER.isInfoEnabled()) {
      LOGGER.info("String_Node_Str");
    }
  }
}
Program: 48279
Project: 48279
Buggy source:
public UntrustedCertificateException(){
}

Fixed version (ground truth):
public UntrustedCertificateException(CertificateInfo certInfo1){
  super(null,"String_Node_Str","String_Node_Str");
  certInfo=certInfo1;
}
Program: 48280
Project: 48280
Buggy source:
@Override public boolean deleteCluster(String name,List<BaseNode> vNodes,StatusUpdater statusUpdator){
  boolean deleted=syncDeleteVMs(vNodes,statusUpdator,true);
  if (vNodes.size() > 0) {
    try {
      deleteChildRps(name,vNodes);
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",e);
    }
    try {
      deleteFolders(vNodes.get(0));
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",e);
    }
  }
  return deleted;
}

Fixed version (ground truth):
@Override public boolean deleteCluster(String name,List<BaseNode> vNodes,StatusUpdater statusUpdator){
  if (vNodes == null || vNodes.size() < 1) {
    logger.error("String_Node_Str");
    return true;
  }
  Folder folder=findFolder(vNodes.get(0));
  boolean deleted=syncDeleteVMs(vNodes,statusUpdator,true);
  try {
    deleteChildRps(name,vNodes);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  try {
    deleteFolders(folder);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  return deleted;
}
Program: 48282
Project: 48282
Buggy source:
@Override @ClusterEntityConcurrentWriteLock @Async(AsyncExecutors.CLUSTER_SYNC_EXEC) public void asyncSyncUp(String clusterName,boolean updateClusterStatus){
  clusterSyncService.syncUp(clusterName,updateClusterStatus);
}

Fixed version (ground truth):
@Override @ClusterEntityConcurrentWriteLock @Async(AsyncExecutors.CLUSTER_SYNC_EXEC) public void asyncSyncUp(String clusterName,boolean updateClusterStatus){
  logger.info("String_Node_Str" + clusterName);
  clusterSyncService.syncUp(clusterName,updateClusterStatus);
}
Program: 48283
Project: 48283
Buggy source:
@Override @ClusterEntityConcurrentWriteLock public void syncUp(String clusterName,boolean updateClusterStatus){
  clusterSyncService.syncUp(clusterName,updateClusterStatus);
}

Fixed version (ground truth):
@Override @ClusterEntityConcurrentWriteLock public void syncUp(String clusterName,boolean updateClusterStatus){
  logger.info("String_Node_Str" + clusterName);
  clusterSyncService.syncUp(clusterName,updateClusterStatus);
}
Program: 48284
Project: 48284
Buggy source:
@Override @ClusterEntityExclusiveWriteLock @Async(AsyncExecutors.CLUSTER_SYNC_EXEC) public void asyncSyncUp(String clusterName,boolean updateClusterStatus){
  clusterSyncService.syncUp(clusterName,updateClusterStatus);
}

Fixed version (ground truth):
@Override @ClusterEntityExclusiveWriteLock @Async(AsyncExecutors.CLUSTER_SYNC_EXEC) public void asyncSyncUp(String clusterName,boolean updateClusterStatus){
  logger.info("String_Node_Str" + clusterName);
  clusterSyncService.syncUp(clusterName,updateClusterStatus);
}
Program: 48285
Project: 48285
Buggy source:
@Override @ClusterEntityExclusiveWriteLock public void syncUp(String clusterName,boolean updateClusterStatus){
  clusterSyncService.syncUp(clusterName,updateClusterStatus);
}

Fixed version (ground truth):
@Override @ClusterEntityExclusiveWriteLock public void syncUp(String clusterName,boolean updateClusterStatus){
  logger.info("String_Node_Str" + clusterName);
  clusterSyncService.syncUp(clusterName,updateClusterStatus);
}
Program: 48287
Project: 48287
Buggy source:
private Set<NodeGroupEntity> convertNodeGroupsToEntities(Gson gson,ClusterEntity clusterEntity,String distro,NodeGroupCreate[] groups,boolean validateWhiteList){
  Set<NodeGroupEntity> nodeGroups=new HashSet<NodeGroupEntity>();
  for (  NodeGroupCreate group : groups) {
    NodeGroupEntity groupEntity=convertGroup(gson,clusterEntity,group,distro,validateWhiteList);
    if (groupEntity != null) {
      nodeGroups.add(groupEntity);
    }
  }
  return nodeGroups;
}

Fixed version (ground truth):
private Set<NodeGroupEntity> convertNodeGroupsToEntities(Gson gson,ClusterEntity clusterEntity,String distro,NodeGroupCreate[] groups,boolean validateWhiteList){
  Set<NodeGroupEntity> nodeGroups=new LinkedHashSet<NodeGroupEntity>();
  for (  NodeGroupCreate group : groups) {
    NodeGroupEntity groupEntity=convertGroup(gson,clusterEntity,group,distro,validateWhiteList);
    if (groupEntity != null) {
      nodeGroups.add(groupEntity);
    }
  }
  return nodeGroups;
}
Program: 48289
Project: 48289
Buggy source:
@Override public ClusterRead findClusterWithNodeGroups(String clusterName){
  ClusterEntity cluster=clusterDao.findWithNodeGroups(clusterName);
  ClusterRead clusterRead=RestObjectManager.clusterEntityToRead(cluster);
  SoftwareManager softMgr=null;
  try {
    softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  int clusterInstanceNum=0;
  List<NodeGroupRead> ngReads=new ArrayList<>();
  for (  NodeGroupEntity ng : cluster.getNodeGroups()) {
    NodeGroupRead ngRead=RestObjectManager.nodeGroupEntityToRead(ng);
    int instanceNum=this.nodeDao.getCountByNodeGroup(ng.getId());
    ngRead.setInstanceNum(instanceNum);
    clusterInstanceNum+=instanceNum;
    ngRead.setComputeOnly(false);
    try {
      ngRead.setComputeOnly(softMgr.isComputeOnlyRoles(ngRead.getRoles()));
    }
 catch (    Exception e) {
    }
    ngReads.add(ngRead);
  }
  clusterRead.setNodeGroups(ngReads);
  clusterRead.setInstanceNum(clusterInstanceNum);
  clusterRead.setTemplateName(this.nodeTemplateDAO.findByMoid(cluster.getTemplateId()).getName());
  return clusterRead;
}

Fixed version (ground truth):
@Override public ClusterRead findClusterWithNodeGroups(String clusterName){
  ClusterEntity cluster=clusterDao.findWithNodeGroups(clusterName);
  ClusterRead clusterRead=RestObjectManager.clusterEntityToRead(cluster);
  SoftwareManager softMgr=null;
  try {
    softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  int clusterInstanceNum=0;
  List<NodeGroupRead> ngReads=new ArrayList<>();
  for (  NodeGroupEntity ng : cluster.getNodeGroupsSortedById()) {
    NodeGroupRead ngRead=RestObjectManager.nodeGroupEntityToRead(ng);
    int instanceNum=this.nodeDao.getCountByNodeGroup(ng.getId());
    ngRead.setInstanceNum(instanceNum);
    clusterInstanceNum+=instanceNum;
    ngRead.setComputeOnly(false);
    try {
      ngRead.setComputeOnly(softMgr.isComputeOnlyRoles(ngRead.getRoles()));
    }
 catch (    Exception e) {
    }
    ngReads.add(ngRead);
  }
  clusterRead.setNodeGroups(ngReads);
  clusterRead.setInstanceNum(clusterInstanceNum);
  clusterRead.setTemplateName(this.nodeTemplateDAO.findByMoid(cluster.getTemplateId()).getName());
  return clusterRead;
}
Program: 48290
Project: 48290
Buggy source:
@Override public ClusterReport queryClusterStatus(ClusterBlueprint blueprint){
  AmClusterDef clusterDef=new AmClusterDef(blueprint,privateKey,getVersion());
  try {
    ServiceStatus status=apiManager.getClusterStatus(blueprint.getName(),blueprint.getHadoopStack());
    clusterDef.getCurrentReport().setStatus(status);
    Map<String,ServiceStatus> hostStates=apiManager.getHostStatus(blueprint.getName());
    Map<String,NodeReport> nodeReports=clusterDef.getCurrentReport().getNodeReports();
    for (    AmNodeDef node : clusterDef.getNodes()) {
      String fqdn=node.getFqdn();
      nodeReports.get(node.getName()).setStatus(hostStates.get(fqdn));
    }
  }
 catch (  NotFoundException e) {
    logger.info("String_Node_Str" + blueprint.getName() + "String_Node_Str");
    return null;
  }
  return clusterDef.getCurrentReport().clone();
}

Fixed version (ground truth):
@Override public ClusterReport queryClusterStatus(ClusterBlueprint blueprint){
  AmClusterDef clusterDef=new AmClusterDef(blueprint,privateKey,getVersion());
  try {
    ServiceStatus status=apiManager.getClusterStatus(blueprint.getName(),blueprint.getHadoopStack());
    clusterDef.getCurrentReport().setStatus(status);
    Map<String,ServiceStatus> hostStates=apiManager.getHostStatus(blueprint.getName());
    Map<String,NodeReport> nodeReports=clusterDef.getCurrentReport().getNodeReports();
    for (    AmNodeDef node : clusterDef.getNodes()) {
      String fqdn=node.getFqdn();
      NodeReport nodeReport=nodeReports.get(node.getName());
      if (nodeReport != null) {
        nodeReport.setStatus(hostStates.get(fqdn));
      }
    }
  }
 catch (  NotFoundException e) {
    logger.info("String_Node_Str" + blueprint.getName() + "String_Node_Str");
    return null;
  }
  return clusterDef.getCurrentReport().clone();
}
Program: 48291
Project: 48291
Buggy source:
private void setNodeTemplateName(ClusterRead clusterRead,String templateId){
  NodeTemplateEntity template=this.nodeTemplateDAO.findByMoid(templateId);
  if (template != null) {
    clusterRead.setTemplateName(template.getName());
  }
 else {
    logger.warn("String_Node_Str" + templateId);
    String notFound=Messages.getString("String_Node_Str");
    clusterRead.setTemplateName(notFound);
  }
}

Fixed version (ground truth):
private void setNodeTemplateName(ClusterRead clusterRead,String templateId){
  NodeTemplateEntity template=null;
  if (templateId != null) {
    template=this.nodeTemplateDAO.findByMoid(templateId);
  }
  if (template != null) {
    clusterRead.setTemplateName(template.getName());
  }
 else {
    logger.warn("String_Node_Str" + templateId + "String_Node_Str");
    String notFound=Messages.getString("String_Node_Str");
    clusterRead.setTemplateName(notFound);
  }
}
Program: 48292
Project: 48292
Buggy source:
private void execChefClient(String specFilePath){
  CommandLine cmdLine=new CommandLine(sudoCmd).addArgument("String_Node_Str").addArgument("String_Node_Str").addArgument("String_Node_Str").addArgument("String_Node_Str" + specFilePath + "String_Node_Str");
  execCommand(cmdLine);
}

Fixed version (ground truth):
private void execChefClient(String specFilePath){
  CommandLine cmdLine=new CommandLine(sudoCmd).addArgument("String_Node_Str").addArgument("String_Node_Str").addArgument("String_Node_Str").addArgument("String_Node_Str" + specFilePath + "String_Node_Str").addArgument("String_Node_Str").addArgument("String_Node_Str");
  execCommand(cmdLine);
}
Program: 48294
Project: 48294
Buggy source:
public static long getHeapSizeMhz(long nodeMemMhz,int groupRoleNums){
  logger.info("String_Node_Str");
  long osMemMhz=1024;
  long hbaseHeapMhz=nodeMemMhz - 1024 * (groupRoleNums - 1) - osMemMhz;
  hbaseHeapMhz=(hbaseHeapMhz > 1024) ? hbaseHeapMhz : 1024;
  ;
  logger.info("String_Node_Str" + hbaseHeapMhz);
  return hbaseHeapMhz;
}

Fixed version (ground truth):
public static long getHeapSizeMhz(long nodeMemMhz,int groupRoleNums){
  logger.info("String_Node_Str");
  long osMemMhz=1024;
  long hbaseHeapMhz=nodeMemMhz - 1024 * (groupRoleNums - 1) - osMemMhz;
  hbaseHeapMhz=(hbaseHeapMhz > 1024) ? hbaseHeapMhz : 1024;
  logger.info("String_Node_Str" + hbaseHeapMhz);
  return hbaseHeapMhz;
}
Program: 48295
Project: 48295
Buggy source:
private void setDiskAttributes(DatastoreType storageType,StorageRead storage,List<String> storeNames){
  if (storageType == null) {
    Set<String> storePattern=datastoreMgr.getLocalDatastoresByNames(storeNames);
    if (storePattern != null && !storePattern.isEmpty()) {
      logger.info("String_Node_Str");
      storage.setControllerType(DiskScsiControllerType.PARA_VIRTUAL_CONTROLLER);
      storage.setAllocType(AllocationType.THICK.name());
    }
 else {
      storage.setControllerType(DiskScsiControllerType.LSI_CONTROLLER);
      storage.setAllocType(AllocationType.THIN.name());
    }
    return;
  }
  if (storageType != DatastoreType.LOCAL) {
    storage.setControllerType(DiskScsiControllerType.LSI_CONTROLLER);
    storage.setAllocType(AllocationType.THIN.name());
  }
 else {
    storage.setControllerType(DiskScsiControllerType.PARA_VIRTUAL_CONTROLLER);
    storage.setAllocType(AllocationType.THICK.name());
  }
}

Fixed version (ground truth):
private void setDiskAttributes(DatastoreType storageType,StorageRead storage,List<String> storeNames){
  if (storageType == null) {
    Set<String> storePattern=datastoreMgr.getLocalDatastoresByNames(storeNames);
    if (storePattern != null && !storePattern.isEmpty()) {
      logger.info("String_Node_Str");
      storage.setControllerType(DiskScsiControllerType.PARA_VIRTUAL_CONTROLLER);
      storage.setAllocType(AllocationType.THICK.name());
    }
 else {
      storage.setControllerType(DiskScsiControllerType.LSI_CONTROLLER);
      storage.setAllocType(AllocationType.THIN.name());
    }
    return;
  }
  DiskScsiControllerType systemSwapDiskControllerType=CommonUtil.getSystemAndSwapControllerType();
  DiskScsiControllerType dataDiskControllerType=CommonUtil.getDataDiskControllerType();
  if (systemSwapDiskControllerType == DiskScsiControllerType.PARA_VIRTUAL_CONTROLLER && dataDiskControllerType == DiskScsiControllerType.LSI_CONTROLLER) {
    logger.warn("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    dataDiskControllerType=DiskScsiControllerType.PARA_VIRTUAL_CONTROLLER;
  }
  storage.setControllerType(dataDiskControllerType);
  storage.setAllocType(AllocationType.THICK.name());
  if (storageType == DatastoreType.SHARED) {
    storage.setAllocType(AllocationType.THIN.name());
  }
}
Program: 48297
Project: 48297
Buggy source:
@Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
  JAXBContext jaxbContext;
  try {
    jaxbContext=JAXBContext.newInstance(Users.class);
    Unmarshaller jaxbUnmarshaller=jaxbContext.createUnmarshaller();
    Users users=(Users)jaxbUnmarshaller.unmarshal(FileUtils.getConfigurationFile(UserService.UsersFile,"String_Node_Str"));
    User userDTO=null;
    if (users != null) {
      for (      User user : users.getUsers()) {
        if (user.getName().equals(username)) {
          userDTO=user;
          break;
        }
 else         if (user.getName().trim().equals("String_Node_Str")) {
          userDTO=user;
          userDTO.setName("String_Node_Str");
        }
      }
    }
    if (null == userDTO) {
      throw new UsernameNotFoundException("String_Node_Str");
    }
    ArrayList<GrantedAuthority> roleList=new ArrayList<GrantedAuthority>();
    roleList.add(new SimpleGrantedAuthority(ADMIN_ROLE));
    return new org.springframework.security.core.userdetails.User(userDTO.getName(),"String_Node_Str",roleList);
  }
 catch (  UsernameNotFoundException userNotFoundEx) {
    throw userNotFoundEx;
  }
catch (  Exception e) {
    logger.error("String_Node_Str" + e.getMessage());
    throw new UsernameNotFoundException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
  JAXBContext jaxbContext;
  try {
    jaxbContext=JAXBContext.newInstance(Users.class);
    Unmarshaller jaxbUnmarshaller=jaxbContext.createUnmarshaller();
    XMLInputFactory xif=XMLInputFactory.newFactory();
    xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES,false);
    XMLStreamReader xsr=xif.createXMLStreamReader(new StreamSource(FileUtils.getConfigurationFile(UserService.UsersFile,"String_Node_Str")));
    Users users=(Users)jaxbUnmarshaller.unmarshal(xsr);
    User userDTO=null;
    if (users != null) {
      for (      User user : users.getUsers()) {
        if (user.getName().equals(username)) {
          userDTO=user;
          break;
        }
 else         if (user.getName().trim().equals("String_Node_Str")) {
          userDTO=user;
          userDTO.setName("String_Node_Str");
        }
      }
    }
    if (null == userDTO) {
      throw new UsernameNotFoundException("String_Node_Str");
    }
    ArrayList<GrantedAuthority> roleList=new ArrayList<GrantedAuthority>();
    roleList.add(new SimpleGrantedAuthority(ADMIN_ROLE));
    return new org.springframework.security.core.userdetails.User(userDTO.getName(),"String_Node_Str",roleList);
  }
 catch (  UsernameNotFoundException userNotFoundEx) {
    throw userNotFoundEx;
  }
catch (  Exception e) {
    logger.error("String_Node_Str" + e.getMessage());
    throw new UsernameNotFoundException("String_Node_Str");
  }
}
Program: 48298
Project: 48298
Buggy source:
@Override public List<NodeTemplateEntity> findByName(String name){
  return this.findByCriteria(Restrictions.eq("String_Node_Str",name).ignoreCase());
}

Fixed version (ground truth):
@Override public List<NodeTemplateEntity> findByName(String name){
  return this.findByCriteria(Restrictions.eq("String_Node_Str",name));
}
Program: 48299
Project: 48299
Buggy source:
@Override public NodeTemplateEntity findByMoid(String vmMoid){
  return findUniqueByCriteria(Restrictions.eq("String_Node_Str",vmMoid).ignoreCase());
}

Fixed version (ground truth):
@Override public NodeTemplateEntity findByMoid(String vmMoid){
  return findUniqueByCriteria(Restrictions.eq("String_Node_Str",vmMoid));
}
Program: 48301
Project: 48301
Buggy source:
@Override public ClusterRead findClusterWithNodeGroups(String clusterName){
  ClusterEntity cluster=clusterDao.findWithNodeGroups(clusterName);
  ClusterRead clusterRead=RestObjectManager.clusterEntityToRead(cluster);
  SoftwareManager softMgr=null;
  try {
    softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  int clusterInstanceNum=0;
  List<NodeGroupRead> ngReads=new ArrayList<>();
  for (  NodeGroupEntity ng : cluster.getNodeGroupsSortedById()) {
    NodeGroupRead ngRead=RestObjectManager.nodeGroupEntityToRead(ng);
    int instanceNum=this.nodeDao.getCountByNodeGroup(ng.getId());
    ngRead.setInstanceNum(instanceNum);
    clusterInstanceNum+=instanceNum;
    ngRead.setComputeOnly(false);
    try {
      ngRead.setComputeOnly(softMgr.isComputeOnlyRoles(ngRead.getRoles()));
    }
 catch (    Exception e) {
    }
    ngReads.add(ngRead);
  }
  clusterRead.setNodeGroups(ngReads);
  clusterRead.setInstanceNum(clusterInstanceNum);
  clusterRead.setTemplateName(this.nodeTemplateDAO.findByMoid(cluster.getTemplateId()).getName());
  return clusterRead;
}

Fixed version (ground truth):
@Override public ClusterRead findClusterWithNodeGroups(String clusterName){
  ClusterEntity cluster=clusterDao.findWithNodeGroups(clusterName);
  ClusterRead clusterRead=RestObjectManager.clusterEntityToRead(cluster);
  SoftwareManager softMgr=null;
  try {
    softMgr=softwareManagerCollector.getSoftwareManager(cluster.getAppManager());
  }
 catch (  Exception e) {
    logger.error("String_Node_Str");
  }
  int clusterInstanceNum=0;
  List<NodeGroupRead> ngReads=new ArrayList<>();
  for (  NodeGroupEntity ng : cluster.getNodeGroupsSortedById()) {
    NodeGroupRead ngRead=RestObjectManager.nodeGroupEntityToRead(ng);
    int instanceNum=this.nodeDao.getCountByNodeGroup(ng.getId());
    ngRead.setInstanceNum(instanceNum);
    clusterInstanceNum+=instanceNum;
    ngRead.setComputeOnly(false);
    try {
      ngRead.setComputeOnly(softMgr.isComputeOnlyRoles(ngRead.getRoles()));
    }
 catch (    Exception e) {
    }
    ngReads.add(ngRead);
  }
  clusterRead.setNodeGroups(ngReads);
  clusterRead.setInstanceNum(clusterInstanceNum);
  setNodeTemplateName(clusterRead,cluster.getTemplateId());
  return clusterRead;
}
Program: 48303
Project: 48303
Buggy source:
public void addHostsToCluster(String clusterName,List<String> hostNames) throws AmbariApiException {
  logger.debug("String_Node_Str" + hostNames + "String_Node_Str"+ clusterName);
  for (  String hostName : hostNames) {
    Response response=null;
    try {
      response=apiResourceRootV1.getClustersResource().getHostsResource(clusterName).addHost(hostName);
    }
 catch (    Exception e) {
      throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
    }
    handleAmbariResponse(response);
  }
}

Fixed version (ground truth):
@Override public void addHostsToCluster(String clusterName,List<String> hostNames) throws AmbariApiException {
  logger.debug("String_Node_Str" + hostNames + "String_Node_Str"+ clusterName);
  for (  String hostName : hostNames) {
    Response response=null;
    try {
      response=apiResourceRootV1.getClustersResource().getHostsResource(clusterName).addHost(hostName);
    }
 catch (    Exception e) {
      throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
    }
    handleAmbariResponse(response);
  }
}
Program: 48304
Project: 48304
Buggy source:
public List<String> getAssociatedConfigGroups(String clusterName,String hostName) throws AmbariApiException {
  String fields="String_Node_Str";
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getConfigGroupsResource(clusterName).readConfigGroupsWithFields(fields);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String strConfGroups=handleAmbariResponse(response);
  ApiConfigGroupList apiConfGroupList=ApiUtils.jsonToObject(ApiConfigGroupList.class,strConfGroups);
  List<String> result=new ArrayList<>();
  if (apiConfGroupList.getConfigGroups() == null) {
    return result;
  }
  for (  ApiConfigGroup group : apiConfGroupList.getConfigGroups()) {
    List<ApiHostInfo> apiHosts=group.getApiConfigGroupInfo().getHosts();
    if (apiHosts == null) {
      continue;
    }
    if (apiHosts.size() == 1) {
      if (hostName.equals(apiHosts.get(0).getHostName())) {
        result.add(group.getApiConfigGroupInfo().getId());
      }
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public List<String> getAssociatedConfigGroups(String clusterName,String hostName) throws AmbariApiException {
  String fields="String_Node_Str";
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getConfigGroupsResource(clusterName).readConfigGroupsWithFields(fields);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String strConfGroups=handleAmbariResponse(response);
  ApiConfigGroupList apiConfGroupList=ApiUtils.jsonToObject(ApiConfigGroupList.class,strConfGroups);
  List<String> result=new ArrayList<>();
  if (apiConfGroupList.getConfigGroups() == null) {
    return result;
  }
  for (  ApiConfigGroup group : apiConfGroupList.getConfigGroups()) {
    List<ApiHostInfo> apiHosts=group.getApiConfigGroupInfo().getHosts();
    if (apiHosts == null) {
      continue;
    }
    if (apiHosts.size() == 1) {
      if (hostName.equals(apiHosts.get(0).getHostName())) {
        result.add(group.getApiConfigGroupInfo().getId());
      }
    }
  }
  return result;
}
Program: 48305
Project: 48305
Buggy source:
public List<String> getExistingHosts(String clusterName,List<String> hostNames) throws AmbariApiException {
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostsResource(clusterName).readHosts();
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String hostList=handleAmbariResponse(response);
  ApiHostList apiHostList=ApiUtils.jsonToObject(ApiHostList.class,hostList);
  List<String> existingHosts=new ArrayList<>();
  if (apiHostList.getApiHosts() != null) {
    for (    ApiHost apiHost : apiHostList.getApiHosts()) {
      if (hostNames.contains(apiHost.getApiHostInfo().getHostName())) {
        existingHosts.add(apiHost.getApiHostInfo().getHostName());
      }
    }
  }
  return existingHosts;
}

Fixed version (ground truth):
@Override public List<String> getExistingHosts(String clusterName,List<String> hostNames) throws AmbariApiException {
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostsResource(clusterName).readHosts();
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String hostList=handleAmbariResponse(response);
  ApiHostList apiHostList=ApiUtils.jsonToObject(ApiHostList.class,hostList);
  List<String> existingHosts=new ArrayList<>();
  if (apiHostList.getApiHosts() != null) {
    for (    ApiHost apiHost : apiHostList.getApiHosts()) {
      if (hostNames.contains(apiHost.getApiHostInfo().getHostName())) {
        existingHosts.add(apiHost.getApiHostInfo().getHostName());
      }
    }
  }
  return existingHosts;
}
Program: 48306
Project: 48306
Buggy source:
public void addComponents(String clusterName,List<String> hostNames,ApiHostComponentsRequest components) throws AmbariApiException {
  logger.info("String_Node_Str" + hostNames);
  ApiHostsRequest hostsRequest=new ApiHostsRequest();
  hostsRequest.setBody(components);
  ApiHostsRequestInfo requestInfo=new ApiHostsRequestInfo();
  hostsRequest.setRequestInfo(requestInfo);
  requestInfo.setContext("String_Node_Str");
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  for (  String hostName : hostNames) {
    builder.append(hostName).append("String_Node_Str");
  }
  builder.deleteCharAt(builder.length() - 1);
  builder.append("String_Node_Str");
  requestInfo.setQueryString(builder.toString());
  String json=ApiUtils.objectToJson(hostsRequest);
  logger.debug("String_Node_Str" + json);
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostsResource(clusterName).addComponentsToHosts(json);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
}

Fixed version (ground truth):
@Override public void addComponents(String clusterName,List<String> hostNames,ApiHostComponentsRequest components) throws AmbariApiException {
  logger.info("String_Node_Str" + hostNames);
  ApiHostsRequest hostsRequest=new ApiHostsRequest();
  hostsRequest.setBody(components);
  ApiHostsRequestInfo requestInfo=new ApiHostsRequestInfo();
  hostsRequest.setRequestInfo(requestInfo);
  requestInfo.setContext("String_Node_Str");
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  for (  String hostName : hostNames) {
    builder.append(hostName).append("String_Node_Str");
  }
  builder.deleteCharAt(builder.length() - 1);
  builder.append("String_Node_Str");
  requestInfo.setQueryString(builder.toString());
  String json=ApiUtils.objectToJson(hostsRequest);
  logger.debug("String_Node_Str" + json);
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostsResource(clusterName).addComponentsToHosts(json);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
}
Program: 48307
Project: 48307
Buggy source:
public ApiRequest installComponents(String clusterName) throws AmbariApiException {
  ApiHostsRequest hostsRequest=AmUtils.createInstallComponentsRequest();
  String json=ApiUtils.objectToJson(hostsRequest);
  logger.debug("String_Node_Str" + json);
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostComponentsResource(clusterName).operationWithFilter(json);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String installJson=handleAmbariResponse(response);
  logger.debug("String_Node_Str" + installJson);
  return ApiUtils.jsonToObject(ApiRequest.class,installJson);
}

Fixed version (ground truth):
@Override public ApiRequest installComponents(String clusterName) throws AmbariApiException {
  ApiHostsRequest hostsRequest=AmUtils.createInstallComponentsRequest();
  String json=ApiUtils.objectToJson(hostsRequest);
  logger.debug("String_Node_Str" + json);
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostComponentsResource(clusterName).operationWithFilter(json);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String installJson=handleAmbariResponse(response);
  logger.debug("String_Node_Str" + installJson);
  return ApiUtils.jsonToObject(ApiRequest.class,installJson);
}
Program: 48308
Project: 48308
Buggy source:
public void deleteAllComponents(String clusterName,String hostName) throws AmbariApiException {
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostsResource(clusterName).deleteHostComponentsResource(hostName);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
}

Fixed version (ground truth):
@Override public void deleteAllComponents(String clusterName,String hostName) throws AmbariApiException {
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostsResource(clusterName).deleteHostComponentsResource(hostName);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
}
Program: 48309
Project: 48309
Buggy source:
public void deleteConfigGroup(String clusterName,String groupId) throws AmbariApiException {
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getConfigGroupsResource(clusterName).deleteConfigGroup(groupId);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
}

Fixed version (ground truth):
@Override public void deleteConfigGroup(String clusterName,String groupId) throws AmbariApiException {
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getConfigGroupsResource(clusterName).deleteConfigGroup(groupId);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
}
Program: 48310
Project: 48310
Buggy source:
public ServiceStatus getClusterStatus(String clusterName,HadoopStack stack) throws AmbariApiException {
  return null;
}

Fixed version (ground truth):
@Override public ServiceStatus getClusterStatus(String clusterName,HadoopStack stack) throws AmbariApiException {
  return null;
}
Program: 48311
Project: 48311
Buggy source:
@Override public ApiRequest getRequest(String clusterName,Long requestId) throws AmbariApiException {
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getRequestsResource(clusterName).readRequest(requestId);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String requestJson=handleAmbariResponse(response);
  logger.debug("String_Node_Str");
  logger.debug(requestJson);
  ApiRequest apiRequest=ApiUtils.jsonToObject(ApiRequest.class,requestJson);
  return apiRequest;
}

Fixed version (ground truth):
@Override public ApiRequest getRequest(String clusterName,Long requestId) throws AmbariApiException {
  Response response=null;
  ApiRequest apiRequest=null;
  int retry_times=10;
  while (apiRequest == null && retry_times > 0) {
    try {
      response=apiResourceRootV1.getClustersResource().getRequestsResource(clusterName).readRequest(requestId);
    }
 catch (    Exception e) {
      throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
    }
    String requestJson=handleAmbariResponse(response);
    logger.debug("String_Node_Str");
    logger.debug(requestJson);
    apiRequest=ApiUtils.jsonToObject(ApiRequest.class,requestJson);
    retry_times-=1;
    try {
      Thread.sleep(3000);
    }
 catch (    InterruptedException e) {
      logger.error(e.getMessage());
    }
  }
  if (apiRequest == null) {
    throw AmbariApiException.CONNOT_FIND_REQUEST(requestId);
  }
  return apiRequest;
}
Program: 48312
Project: 48312
Buggy source:
public void createConfigGroups(String clusterName,List<ApiConfigGroup> configGroups) throws AmbariApiException {
  String confGroups=ApiUtils.objectToJson(configGroups);
  logger.debug("String_Node_Str" + confGroups);
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getConfigGroupsResource(clusterName).createConfigGroups(confGroups);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
}

Fixed version (ground truth):
@Override public void createConfigGroups(String clusterName,List<ApiConfigGroup> configGroups) throws AmbariApiException {
  String confGroups=ApiUtils.objectToJson(configGroups);
  logger.debug("String_Node_Str" + confGroups);
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getConfigGroupsResource(clusterName).createConfigGroups(confGroups);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
}
Program: 48313
Project: 48313
Buggy source:
public boolean deleteBlueprint(String blueprintName) throws AmbariApiException {
  logger.info("String_Node_Str" + blueprintName);
  Response response=null;
  try {
    response=apiResourceRootV1.getBlueprintsResource().deleteBlueprint(blueprintName);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
  return true;
}

Fixed version (ground truth):
@Override public boolean deleteBlueprint(String blueprintName) throws AmbariApiException {
  logger.info("String_Node_Str" + blueprintName);
  Response response=null;
  try {
    response=apiResourceRootV1.getBlueprintsResource().deleteBlueprint(blueprintName);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  handleAmbariResponse(response);
  return true;
}
Program: 48314
Project: 48314
Buggy source:
public ApiRequest stopAllComponentsInHosts(String clusterName,List<String> hostNames) throws AmbariApiException {
  ApiHostsRequest hostsRequest=new ApiHostsRequest();
  ApiHostComponentsRequest apiComponents=new ApiHostComponentsRequest();
  hostsRequest.setBody(apiComponents);
  ApiComponentInfo hostRoles=new ApiComponentInfo();
  hostRoles.setState("String_Node_Str");
  apiComponents.setHostRoles(hostRoles);
  ApiHostsRequestInfo requestInfo=new ApiHostsRequestInfo();
  hostsRequest.setRequestInfo(requestInfo);
  requestInfo.setContext("String_Node_Str");
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  for (  String hostName : hostNames) {
    builder.append(hostName).append("String_Node_Str");
  }
  builder.deleteCharAt(builder.length() - 1);
  builder.append("String_Node_Str");
  requestInfo.setQueryString(builder.toString());
  String startJson=ApiUtils.objectToJson(hostsRequest);
  logger.debug("String_Node_Str" + startJson);
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostComponentsResource(clusterName).operationWithFilter(startJson);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String responseJson=handleAmbariResponse(response);
  logger.debug("String_Node_Str" + responseJson);
  return ApiUtils.jsonToObject(ApiRequest.class,responseJson);
}

Fixed version (ground truth):
@Override public ApiRequest stopAllComponentsInHosts(String clusterName,List<String> hostNames) throws AmbariApiException {
  ApiHostsRequest hostsRequest=new ApiHostsRequest();
  ApiHostComponentsRequest apiComponents=new ApiHostComponentsRequest();
  hostsRequest.setBody(apiComponents);
  ApiComponentInfo hostRoles=new ApiComponentInfo();
  hostRoles.setState("String_Node_Str");
  apiComponents.setHostRoles(hostRoles);
  ApiHostsRequestInfo requestInfo=new ApiHostsRequestInfo();
  hostsRequest.setRequestInfo(requestInfo);
  requestInfo.setContext("String_Node_Str");
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  for (  String hostName : hostNames) {
    builder.append(hostName).append("String_Node_Str");
  }
  builder.deleteCharAt(builder.length() - 1);
  builder.append("String_Node_Str");
  requestInfo.setQueryString(builder.toString());
  String startJson=ApiUtils.objectToJson(hostsRequest);
  logger.debug("String_Node_Str" + startJson);
  Response response=null;
  try {
    response=apiResourceRootV1.getClustersResource().getHostComponentsResource(clusterName).operationWithFilter(startJson);
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String responseJson=handleAmbariResponse(response);
  logger.debug("String_Node_Str" + responseJson);
  return ApiUtils.jsonToObject(ApiRequest.class,responseJson);
}
Program: 48315
Project: 48315
Buggy source:
public ApiStackServiceList getStackWithCompAndConfigs(String stackName,String stackVersion) throws AmbariApiException {
  return null;
}

Fixed version (ground truth):
@Override public ApiStackServiceList getStackWithCompAndConfigs(String stackName,String stackVersion) throws AmbariApiException {
  return null;
}
Program: 48316
Project: 48316
Buggy source:
public String healthCheck() throws AmbariApiException {
  Response response=null;
  try {
    response=apiResourceRootV1.getHealthCheckResource().check();
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String healthStatus=handleAmbariResponse(response);
  return healthStatus;
}

Fixed version (ground truth):
@Override public String healthCheck() throws AmbariApiException {
  Response response=null;
  try {
    response=apiResourceRootV1.getHealthCheckResource().check();
  }
 catch (  Exception e) {
    throw AmbariApiException.CANNOT_CONNECT_AMBARI_SERVER(e);
  }
  String healthStatus=handleAmbariResponse(response);
  return healthStatus;
}
Program: 48317
Project: 48317
Buggy source:
public void validateRolesForShrink(NodeGroupInfo groupInfo) throws SoftwareManagementPluginException {
  ValidateRolesUtil.validateRolesForShrink(AmUtils.getConfDir(),groupInfo);
}

Fixed version (ground truth):
@Override public void validateRolesForShrink(NodeGroupInfo groupInfo) throws SoftwareManagementPluginException {
  ValidateRolesUtil.validateRolesForShrink(AmUtils.getConfDir(),groupInfo);
}
Program: 48321
Project: 48321
Buggy source:
public Map<String,String> getRackTopology(String clusterName,String topology){
  ClusterRead cluster=clusterEntityMgr.toClusterRead(clusterName);
  Set<String> hosts=new HashSet<String>();
  List<NodeRead> nodes=new ArrayList<NodeRead>();
  for (  NodeGroupRead nodeGroup : cluster.getNodeGroups()) {
    for (    NodeRead node : nodeGroup.getInstances()) {
      if (node.getMoId() != null) {
        hosts.add(node.getHostName());
        nodes.add(node);
      }
    }
  }
  if (CommonUtil.isBlank(topology)) {
    topology=cluster.getTopologyPolicy().toString();
  }
  AuAssert.check(hosts.size() > 0);
  clusterConfigMgr.validateRackTopologyUploaded(hosts,topology);
  return clusterConfigMgr.buildTopology(nodes,topology);
}

Fixed version (ground truth):
public Map<String,String> getRackTopology(String clusterName,String topology){
  ClusterRead cluster=clusterEntityMgr.toClusterRead(clusterName,true);
  Set<String> hosts=new HashSet<String>();
  List<NodeRead> nodes=new ArrayList<NodeRead>();
  for (  NodeGroupRead nodeGroup : cluster.getNodeGroups()) {
    for (    NodeRead node : nodeGroup.getInstances()) {
      if (node.getMoId() != null) {
        hosts.add(node.getHostName());
        nodes.add(node);
      }
    }
  }
  if (CommonUtil.isBlank(topology)) {
    topology=cluster.getTopologyPolicy().toString();
  }
  AuAssert.check(hosts.size() > 0);
  clusterConfigMgr.validateRackTopologyUploaded(hosts,topology);
  return clusterConfigMgr.buildTopology(nodes,topology);
}
Program: 48322
Project: 48322
Buggy source:
public ClusterRead getClusterByName(String clusterName,boolean realTime){
  ClusterEntity cluster=clusterEntityMgr.findByName(clusterName);
  if (cluster == null) {
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  if (realTime && cluster.getStatus().isSyncServiceStatus()) {
    refreshClusterStatus(clusterName);
  }
  return clusterEntityMgr.toClusterRead(clusterName);
}

Fixed version (ground truth):
public ClusterRead getClusterByName(String clusterName,boolean realTime){
  ClusterEntity cluster=clusterEntityMgr.findByName(clusterName);
  if (cluster == null) {
    throw BddException.NOT_FOUND("String_Node_Str",clusterName);
  }
  java.util.Date startTime=new java.util.Date();
  if (realTime && cluster.getStatus().isSyncServiceStatus()) {
    refreshClusterStatus(clusterName);
  }
  logger.debug("String_Node_Str" + (new java.util.Date().getTime() - startTime.getTime()));
  return clusterEntityMgr.toClusterRead(clusterName,realTime);
}
Program: 48323
Project: 48323
Buggy source:
public List<ClusterRead> getClusters(Boolean realTime){
  List<ClusterRead> clusters=new ArrayList<ClusterRead>();
  List<ClusterEntity> clusterEntities=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity entity : clusterEntities) {
    clusters.add(getClusterByName(entity.getName(),realTime));
  }
  return clusters;
}

Fixed version (ground truth):
public List<ClusterRead> getClusters(Boolean realTime){
  java.util.Date startTime=new java.util.Date();
  List<ClusterRead> clusters=new ArrayList<ClusterRead>();
  List<ClusterEntity> clusterEntities=clusterEntityMgr.findAllClusters();
  logger.debug("String_Node_Str" + (new java.util.Date().getTime() - startTime.getTime()));
  for (  ClusterEntity entity : clusterEntities) {
    clusters.add(getClusterByName(entity.getName(),realTime));
  }
  logger.debug("String_Node_Str" + (new java.util.Date().getTime() - startTime.getTime()));
  return clusters;
}
Program: 48324
Project: 48324
Buggy source:
public ClusterRead toClusterRead(String clusterName,boolean ignoreObsoleteNode);

Fixed version (ground truth):
public ClusterRead toClusterRead(String clusterName,boolean withNodesList,boolean ignoreObsoleteNode);
Program: 48330
Project: 48330
Buggy source:
public static ClusterManagerException NODE_GROUP_CANNOT_BE_ZERO(String clusterName,String nodeGroupName){
  return new ClusterManagerException(null,"String_Node_Str",clusterName,nodeGroupName);
}

Fixed version (ground truth):
public static ClusterManagerException NODE_GROUP_CANNOT_BE_ZERO(String clusterName){
  return new ClusterManagerException(null,"String_Node_Str",clusterName);
}