nus-yam/ex-repair huggingface dataset:
Program: 48568
Project: 48568
Buggy source:
@Override public boolean onDeleteCluster(ClusterBlueprint clusterBlueprint,ClusterReportQueue reports) throws SoftwareManagementPluginException {
  try {
    String clusterName=clusterBlueprint.getName();
    if (!onStopCluster(clusterBlueprint,reports)) {
      logger.error("String_Node_Str");
    }
    List<String> serviceNames=apiManager.getClusterServicesNames(clusterName);
    if (serviceNames != null && !serviceNames.isEmpty()) {
      for (      String serviceName : serviceNames) {
        ApiRequest deleteService=apiManager.deleteService(clusterName,serviceName);
      }
    }
    List<ApiHost> hosts=apiManager.getHostsSummaryInfo(clusterName).getApiHosts();
    if (hosts != null && !hosts.isEmpty()) {
      for (      ApiHost host : hosts) {
        String hostName=host.getApiHostInfo().getHostName();
        ApiRequest deleteHost=apiManager.deleteHost(clusterName,hostName);
      }
    }
    ApiRequest deleteCluster=apiManager.deleteCluster(clusterBlueprint.getName());
    ApiRequest deleteBlueprint=apiManager.deleteBlueprint(clusterBlueprint.getName());
    return true;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw SoftwareManagementPluginException.DELETE_CLUSTER_FAILED(clusterBlueprint.getName(),e);
  }
}

Fixed version (ground truth):
@Override public boolean onDeleteCluster(ClusterBlueprint clusterBlueprint,ClusterReportQueue reports) throws SoftwareManagementPluginException {
  try {
    String clusterName=clusterBlueprint.getName();
    AmClusterDef clusterDef=new AmClusterDef(clusterBlueprint,null);
    if (isProvisioned(clusterName) && isClusterProvisionedByBDE(clusterDef)) {
      if (!onStopCluster(clusterBlueprint,reports)) {
        logger.error("String_Node_Str");
      }
      List<String> serviceNames=apiManager.getClusterServicesNames(clusterName);
      if (serviceNames != null && !serviceNames.isEmpty()) {
        for (        String serviceName : serviceNames) {
          apiManager.deleteService(clusterName,serviceName);
        }
      }
      if (apiManager.getHostsSummaryInfo(clusterName) != null) {
        List<ApiHost> hosts=apiManager.getHostsSummaryInfo(clusterName).getApiHosts();
        if (hosts != null && !hosts.isEmpty()) {
          for (          ApiHost host : hosts) {
            assert(host.getApiHostInfo() != null);
            String hostName=host.getApiHostInfo().getHostName();
            apiManager.deleteHost(clusterName,hostName);
          }
        }
      }
      apiManager.deleteCluster(clusterName);
    }
    if (isBlueprintCreated(clusterDef) && isBlueprintCreatedByBDE(clusterDef)) {
      apiManager.deleteBlueprint(clusterName);
    }
    ApiPersist persist=new ApiPersist("String_Node_Str");
    apiManager.updatePersist(persist);
    return true;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw SoftwareManagementPluginException.DELETE_CLUSTER_FAILED(clusterBlueprint.getName(),e);
  }
}
Program: 48569
Project: 48569
Buggy source:
public String getPassword(){
  if (this.password == "String_Node_Str") {
    return "String_Node_Str";
  }
  String password=null;
  try {
    password=EncryptionGuard.decode(this.password);
  }
 catch (  UnsupportedEncodingException e) {
    logger.warn("String_Node_Str",e);
  }
catch (  GeneralSecurityException e) {
    logger.warn("String_Node_Str",e);
  }
  return password;
}

Fixed version (ground truth):
public String getPassword(){
  if (this.password == null || this.password.isEmpty()) {
    return "String_Node_Str";
  }
  String password=null;
  try {
    password=EncryptionGuard.decode(this.password);
  }
 catch (  UnsupportedEncodingException e) {
    logger.warn("String_Node_Str",e);
  }
catch (  GeneralSecurityException e) {
    logger.warn("String_Node_Str",e);
  }
  return password;
}
Program: 48570
Project: 48570
Buggy source:
public void modifySoftwareManager(AppManagerAdd appManagerAdd){
  logger.debug("String_Node_Str" + appManagerAdd);
  String name=appManagerAdd.getName();
  if (Constants.IRONFAN.equals(name)) {
    logger.error("String_Node_Str");
    throw SoftwareManagerCollectorException.CAN_NOT_MODIFY_DEFAULT();
  }
  AppManagerEntity appManager=appManagerService.findAppManagerByName(name);
  if (null == appManager) {
    logger.error("String_Node_Str" + name);
    throw SoftwareManagerCollectorException.APPMANAGER_NOT_FOUND(name);
  }
  String sslCertificate=appManagerAdd.getSslCertificate();
  if (!CommonUtil.isBlank(sslCertificate)) {
    saveSslCertificate(sslCertificate);
  }
  logger.info("String_Node_Str" + appManagerAdd);
  SoftwareManager softwareManager=loadSoftwareManager(appManagerAdd);
  logger.info("String_Node_Str");
  validateSoftwareManager(name,softwareManager);
  logger.info("String_Node_Str");
  appManagerService.modifyAppManager(appManagerAdd);
  logger.info("String_Node_Str");
  cache.remove(name);
  logger.info("String_Node_Str");
  cache.put(name,softwareManager);
  logger.debug("String_Node_Str" + appManagerAdd);
}

Fixed version (ground truth):
public synchronized void modifySoftwareManager(AppManagerAdd appManagerAdd){
  logger.debug("String_Node_Str" + appManagerAdd);
  String name=appManagerAdd.getName();
  if (Constants.IRONFAN.equals(name)) {
    logger.error("String_Node_Str");
    throw SoftwareManagerCollectorException.CAN_NOT_MODIFY_DEFAULT();
  }
  AppManagerEntity appManager=appManagerService.findAppManagerByName(name);
  if (null == appManager) {
    logger.error("String_Node_Str" + name);
    throw SoftwareManagerCollectorException.APPMANAGER_NOT_FOUND(name);
  }
  String sslCertificate=appManagerAdd.getSslCertificate();
  if (!CommonUtil.isBlank(sslCertificate)) {
    saveSslCertificate(sslCertificate);
  }
  logger.info("String_Node_Str" + appManagerAdd);
  SoftwareManager softwareManager=loadSoftwareManager(appManagerAdd);
  logger.info("String_Node_Str");
  validateSoftwareManager(name,softwareManager);
  logger.info("String_Node_Str");
  appManagerService.modifyAppManager(appManagerAdd);
  logger.info("String_Node_Str");
  cache.remove(name);
  logger.info("String_Node_Str");
  cache.put(name,softwareManager);
  logger.debug("String_Node_Str" + appManagerAdd);
}
Program: 48571
Project: 48571
Buggy source:
/** 
 * Get software manager instance
 * @param name
 * @return null if the name does not exist
 */
public synchronized SoftwareManager getSoftwareManager(String name){
  if (CommonUtil.isBlank(name)) {
    return cache.get(Constants.IRONFAN);
  }
  if (cache.containsKey(name)) {
    return cache.get(name);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get software manager instance
 * @param name
 * @return null if the name does not exist
 */
public SoftwareManager getSoftwareManager(String name){
  if (CommonUtil.isBlank(name)) {
    return cache.get(Constants.IRONFAN);
  }
  if (cache.containsKey(name)) {
    return cache.get(name);
  }
  return null;
}
Program: 48572
Project: 48572
Buggy source:
/** 
 * Software manager name will be unique inside of BDE. Otherwise, creation will fail. The appmanager information should be persisted in meta-db
 * @param appManagerAdd
 */
public synchronized void createSoftwareManager(AppManagerAdd appManagerAdd){
  logger.info("String_Node_Str" + appManagerAdd.getName());
  if (appManagerService.findAppManagerByName(appManagerAdd.getName()) != null) {
    logger.error("String_Node_Str" + appManagerAdd.getName() + "String_Node_Str");
    throw SoftwareManagerCollectorException.DUPLICATE_NAME(appManagerAdd.getName());
  }
  String sslCertificate=appManagerAdd.getSslCertificate();
  if (!CommonUtil.isBlank(sslCertificate)) {
    saveSslCertificate(sslCertificate);
  }
  SoftwareManager softwareManager=loadSoftwareManager(appManagerAdd);
  validateSoftwareManager(appManagerAdd.getName(),softwareManager);
  cache.put(appManagerAdd.getName(),softwareManager);
  logger.info("String_Node_Str");
  appManagerService.addAppManager(appManagerAdd);
}

Fixed version (ground truth):
/** 
 * Software manager name will be unique inside of BDE. Otherwise, creation will fail. The appmanager information should be persisted in meta-db
 * @param appManagerAdd
 */
public void createSoftwareManager(AppManagerAdd appManagerAdd){
  logger.info("String_Node_Str");
  String sslCertificate=appManagerAdd.getSslCertificate();
  if (!CommonUtil.isBlank(sslCertificate)) {
    saveSslCertificate(sslCertificate);
  }
  SoftwareManager softwareManager=loadSoftwareManager(appManagerAdd);
  validateSoftwareManager(appManagerAdd.getName(),softwareManager);
  logger.info("String_Node_Str");
  createSoftwareManagerInternal(appManagerAdd,softwareManager);
}
Program: 48573
Project: 48573
Buggy source:
public void deleteSoftwareManager(String appManagerName){
  logger.debug("String_Node_Str" + appManagerName);
  if (Constants.IRONFAN.equals(appManagerName)) {
    logger.error("String_Node_Str");
    throw SoftwareManagerCollectorException.CAN_NOT_DELETE_DEFAULT();
  }
  appManagerService.deleteAppManager(appManagerName);
  logger.debug("String_Node_Str" + appManagerName);
  cache.remove(appManagerName);
  logger.debug("String_Node_Str" + appManagerName + "String_Node_Str");
}

Fixed version (ground truth):
public synchronized void deleteSoftwareManager(String appManagerName){
  logger.debug("String_Node_Str" + appManagerName);
  if (Constants.IRONFAN.equals(appManagerName)) {
    logger.error("String_Node_Str");
    throw SoftwareManagerCollectorException.CAN_NOT_DELETE_DEFAULT();
  }
  appManagerService.deleteAppManager(appManagerName);
  logger.debug("String_Node_Str" + appManagerName);
  cache.remove(appManagerName);
  logger.debug("String_Node_Str" + appManagerName + "String_Node_Str");
}
Program: 48574
Project: 48574
Buggy source:
/** 
 * @param name
 * @param softwareManager
 */
private void validateSoftwareManager(String name,SoftwareManager softwareManager){
  logger.info("String_Node_Str");
  try {
    if (!softwareManager.echo()) {
      logger.error("String_Node_Str" + name + "String_Node_Str");
      throw SoftwareManagerCollectorException.ECHO_FAILURE(name);
    }
  }
 catch (  SoftwareManagementPluginException e) {
    logger.error("String_Node_Str" + name + "String_Node_Str",e);
    throw SoftwareManagerCollectorException.CONNECT_FAILURE(name,e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param name
 * @param softwareManager
 */
private void validateSoftwareManager(String name,final SoftwareManager softwareManager){
  logger.info("String_Node_Str");
  try {
    ExecutorService exec=Executors.newFixedThreadPool(1);
    Future<Boolean> futureResult=exec.submit(new Callable<Boolean>(){
      @Override public Boolean call() throws Exception {
        return softwareManager.echo();
      }
    }
);
    boolean gotEcho=false;
    Boolean result=(Boolean)waitForThreadResult(futureResult);
    if (null != result) {
      gotEcho=result;
    }
    exec.shutdown();
    if (!gotEcho) {
      logger.error("String_Node_Str" + name + "String_Node_Str");
      throw SoftwareManagerCollectorException.ECHO_FAILURE(name);
    }
  }
 catch (  SoftwareManagementPluginException e) {
    logger.error("String_Node_Str" + name + "String_Node_Str",e);
    throw SoftwareManagerCollectorException.CONNECT_FAILURE(name,e.getMessage());
  }
}
Program: 48575
Project: 48575
Buggy source:
private static <T>void validateConfigType(Map<String,Object> config,List<Map<String,Map<String,List<T>>>> list,List<String> warningMsgList){
  if (warningMsgList != null) {
    String configType="String_Node_Str";
    List<String> grayList=new ArrayList<String>();
    boolean found=false;
    for (    Entry<String,Object> configTypeEntry : config.entrySet()) {
      configType=configTypeEntry.getKey();
      found=false;
      for (      Map<String,Map<String,List<T>>> listTypeMap : list) {
        if (listTypeMap.containsKey(configType)) {
          found=true;
        }
      }
      if (!found) {
        grayList.add(configType);
      }
    }
    if (!found) {
      StringBuffer errorMsg=new StringBuffer();
      String be="String_Node_Str";
      errorMsg.append(Constants.CLUSTER_CONFIG_TYPE_NOT_RAGULARLY_BEFORE);
      for (      String grayConfigType : grayList) {
        errorMsg.append(grayConfigType);
        errorMsg.append("String_Node_Str");
      }
      if (grayList.size() > 1) {
        be="String_Node_Str";
      }
      errorMsg.replace(errorMsg.length() - 2,errorMsg.length(),be + Constants.CLUSTER_CONFIG_TYPE_NOT_RAGULARLY_AFTER);
      warningMsgList.add(errorMsg.toString());
    }
  }
}

Fixed version (ground truth):
private static <T>void validateConfigType(Map<String,Object> config,List<Map<String,Map<String,List<T>>>> list,List<String> warningMsgList){
  if ((config.size() > 0) && (warningMsgList != null)) {
    String configType="String_Node_Str";
    List<String> grayList=new ArrayList<String>();
    boolean found=false;
    for (    Entry<String,Object> configTypeEntry : config.entrySet()) {
      configType=configTypeEntry.getKey();
      found=false;
      for (      Map<String,Map<String,List<T>>> listTypeMap : list) {
        if (listTypeMap.containsKey(configType)) {
          found=true;
        }
      }
      if (!found) {
        grayList.add(configType);
      }
    }
    if (!found) {
      StringBuffer errorMsg=new StringBuffer();
      String be="String_Node_Str";
      errorMsg.append(Constants.CLUSTER_CONFIG_TYPE_NOT_RAGULARLY_BEFORE);
      for (      String grayConfigType : grayList) {
        errorMsg.append(grayConfigType);
        errorMsg.append("String_Node_Str");
      }
      if (grayList.size() > 1) {
        be="String_Node_Str";
      }
      errorMsg.replace(errorMsg.length() - 2,errorMsg.length(),be + Constants.CLUSTER_CONFIG_TYPE_NOT_RAGULARLY_AFTER);
      warningMsgList.add(errorMsg.toString());
    }
  }
}
Program: 48576
Project: 48576
Buggy source:
/** 
 * Validate role's existence
 * @param blueprint
 * @param distroRoles
 * @return
 * @throws SoftwareManagementPluginException
 */
private boolean validateRoles(ClusterBlueprint blueprint,List<String> distroRoles) throws ValidationException {
  assert(blueprint != null && distroRoles != null);
  List<String> failedMsgList=new ArrayList<String>();
  List<String> warningMsgList=new ArrayList<String>();
  checkUnsupportedRoles(blueprint,distroRoles,failedMsgList);
  boolean result=validateRoleDependency(failedMsgList,blueprint);
  validateGroupConfig(blueprint,failedMsgList,warningMsgList);
  if (!failedMsgList.isEmpty() || !warningMsgList.isEmpty()) {
    throw ValidationException.VALIDATION_FAIL("String_Node_Str",failedMsgList,warningMsgList);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Validate role's existence
 * @param blueprint
 * @param distroRoles
 * @return
 * @throws SoftwareManagementPluginException
 */
private boolean validateRoles(ClusterBlueprint blueprint,List<String> distroRoles) throws ValidationException {
  assert(blueprint != null && distroRoles != null);
  List<String> failedMsgList=new ArrayList<String>();
  List<String> warningMsgList=new ArrayList<String>();
  checkUnsupportedRoles(blueprint,distroRoles,failedMsgList);
  boolean result=validateRoleDependency(failedMsgList,blueprint);
  if (!Constants.MAPR_VENDOR.equalsIgnoreCase(blueprint.getHadoopStack().getVendor())) {
    validateGroupConfig(blueprint,failedMsgList,warningMsgList);
  }
  if (!failedMsgList.isEmpty() || !warningMsgList.isEmpty()) {
    throw ValidationException.VALIDATION_FAIL("String_Node_Str",failedMsgList,warningMsgList);
  }
  return result;
}
Program: 48577
Project: 48577
Buggy source:
public boolean validateBlueprint(ClusterBlueprint blueprint,List<String> distroRoles) throws ValidationException {
  logger.info("String_Node_Str" + blueprint.getName());
  if (Constants.MAPR_VENDOR.equalsIgnoreCase(blueprint.getHadoopStack().getVendor())) {
    return true;
  }
  return validateNoneMaprDistros(blueprint,distroRoles);
}

Fixed version (ground truth):
public boolean validateBlueprint(ClusterBlueprint blueprint,List<String> distroRoles) throws ValidationException {
  logger.info("String_Node_Str" + blueprint.getName());
  return validateDistros(blueprint,distroRoles);
}
Program: 48585
Project: 48585
Buggy source:
private void applyInfraChanges(ClusterCreate cluster,ClusterBlueprint blueprint){
  cluster.setConfiguration(blueprint.getConfiguration());
  sortNodeGroups(cluster,blueprint);
  for (int i=0; i < blueprint.getNodeGroups().size(); i++) {
    NodeGroupInfo group=blueprint.getNodeGroups().get(i);
    NodeGroupCreate groupCreate=cluster.getNodeGroups()[i];
    groupCreate.setConfiguration(group.getConfiguration());
    groupCreate.setRoles(group.getRoles());
    groupCreate.setInstanceType(group.getInstanceType());
    groupCreate.setPlacementPolicies(group.getPlacement());
    if (groupCreate.getStorage() == null) {
      groupCreate.setStorage(new StorageRead());
    }
    groupCreate.getStorage().setSizeGB(group.getStorageSize());
    groupCreate.getStorage().setExpectedTypeFromRoles(group.getStorageExpectedType());
  }
  cluster.setExternalHDFS(blueprint.getExternalHDFS());
  cluster.setExternalMapReduce(blueprint.getExternalMapReduce());
}

Fixed version (ground truth):
private void applyInfraChanges(ClusterCreate cluster,ClusterBlueprint blueprint){
  cluster.setConfiguration(blueprint.getConfiguration());
  sortNodeGroups(cluster,blueprint);
  for (int i=0; i < blueprint.getNodeGroups().size(); i++) {
    NodeGroupInfo group=blueprint.getNodeGroups().get(i);
    NodeGroupCreate groupCreate=cluster.getNodeGroups()[i];
    groupCreate.setConfiguration(group.getConfiguration());
    groupCreate.setRoles(group.getRoles());
    groupCreate.setInstanceType(group.getInstanceType());
    groupCreate.setPlacementPolicies(group.getPlacement());
    if (groupCreate.getStorage() == null) {
      groupCreate.setStorage(new StorageRead());
    }
    groupCreate.getStorage().setSizeGB(group.getStorageSize());
  }
  cluster.setExternalHDFS(blueprint.getExternalHDFS());
  cluster.setExternalMapReduce(blueprint.getExternalMapReduce());
}
Program: 48588
Project: 48588
Buggy source:
public void updateInfrastructure(ClusterBlueprint blueprint){
  expandDefaultCluster(blueprint);
  updateExternalConfig(blueprint);
  addTempFSServerRole(blueprint);
  sortNodeGroupRoles(blueprint);
  sortGroups(blueprint);
}

Fixed version (ground truth):
public void updateInfrastructure(ClusterBlueprint blueprint){
  updateExternalConfig(blueprint);
  addTempFSServerRole(blueprint);
  sortNodeGroupRoles(blueprint);
  sortGroups(blueprint);
}
Program: 48591
Project: 48591
Buggy source:
/** 
 * There are two approach to create a cluster: 1) specify a cluster type and optionally overwriting the parameters 2) specify a customized spec with cluster type not specified
 * @param spec spec with customized field
 * @return customized cluster spec
 * @throws FileNotFoundException
 */
public static ClusterCreate getCustomizedSpec(ClusterCreate spec) throws FileNotFoundException {
  if ((spec.getType() == null) || (spec.getType() != null && spec.isSpecFile())) {
    return spec;
  }
  ClusterCreate newSpec=createDefaultSpec(spec.getType(),spec.getDistroVendor(),spec.getDistroVersion());
  if (spec.getName() != null) {
    newSpec.setName(spec.getName());
  }
  newSpec.setPassword(spec.getPassword());
  if (!CommonUtil.isBlank(spec.getAppManager())) {
    newSpec.setAppManager(spec.getAppManager());
  }
  if (spec.getDistro() != null) {
    newSpec.setDistro(spec.getDistro());
  }
  if (spec.getDistroVendor() != null) {
    newSpec.setDistroVendor(spec.getDistroVendor());
  }
  if (spec.getDistroVersion() != null) {
    newSpec.setDistroVersion(spec.getDistroVersion());
  }
  if (spec.getDsNames() != null) {
    newSpec.setDsNames(spec.getDsNames());
  }
  if (spec.getRpNames() != null) {
    newSpec.setRpNames(spec.getRpNames());
  }
  if (spec.getNetworkConfig() != null) {
    newSpec.setNetworkConfig(spec.getNetworkConfig());
  }
  if (spec.getTopologyPolicy() != null) {
    newSpec.setTopologyPolicy(spec.getTopologyPolicy());
  }
  return newSpec;
}

Fixed version (ground truth):
/** 
 * There are two approach to create a cluster: 1) specify a cluster type and optionally overwriting the parameters 2) specify a customized spec with cluster type not specified
 * @param spec spec with customized field
 * @return customized cluster spec
 * @throws FileNotFoundException
 */
public static ClusterCreate getCustomizedSpec(ClusterCreate spec,String appManagerType) throws FileNotFoundException {
  if ((spec.getType() == null) || (spec.getType() != null && spec.isSpecFile())) {
    return spec;
  }
  ClusterCreate newSpec=createDefaultSpec(spec.getType(),spec.getDistroVendor(),spec.getDistroVersion(),appManagerType);
  if (spec.getName() != null) {
    newSpec.setName(spec.getName());
  }
  newSpec.setPassword(spec.getPassword());
  if (!CommonUtil.isBlank(spec.getAppManager())) {
    newSpec.setAppManager(spec.getAppManager());
  }
  if (spec.getDistro() != null) {
    newSpec.setDistro(spec.getDistro());
  }
  if (spec.getDistroVendor() != null) {
    newSpec.setDistroVendor(spec.getDistroVendor());
  }
  if (spec.getDistroVersion() != null) {
    newSpec.setDistroVersion(spec.getDistroVersion());
  }
  if (spec.getDsNames() != null) {
    newSpec.setDsNames(spec.getDsNames());
  }
  if (spec.getRpNames() != null) {
    newSpec.setRpNames(spec.getRpNames());
  }
  if (spec.getNetworkConfig() != null) {
    newSpec.setNetworkConfig(spec.getNetworkConfig());
  }
  if (spec.getTopologyPolicy() != null) {
    newSpec.setTopologyPolicy(spec.getTopologyPolicy());
  }
  return newSpec;
}
Program: 48592
Project: 48592
Buggy source:
public NodeGroupInfo toNodeGroupInfo(){
  NodeGroupInfo nodeGroupInfo=new NodeGroupInfo();
  nodeGroupInfo.setName(name);
  nodeGroupInfo.setInstanceNum(instanceNum);
  nodeGroupInfo.setRoles(roles);
  nodeGroupInfo.setConfiguration(configuration);
  if (haFlag.equalsIgnoreCase(Constants.HA_FLAG_FT) || haFlag.equalsIgnoreCase(Constants.HA_FLAG_ON)) {
    nodeGroupInfo.setHaEnabled(true);
  }
  nodeGroupInfo.setInstanceType(instanceType);
  nodeGroupInfo.setPlacement(placementPolicies);
  if (storage != null) {
    nodeGroupInfo.setStorageSize(storage.getSizeGB());
    nodeGroupInfo.setStorageType(storage.getType());
  }
  nodeGroupInfo.setNodes(null);
  return nodeGroupInfo;
}

Fixed version (ground truth):
public NodeGroupInfo toNodeGroupInfo(){
  NodeGroupInfo nodeGroupInfo=new NodeGroupInfo();
  nodeGroupInfo.setName(name);
  nodeGroupInfo.setInstanceNum(instanceNum);
  nodeGroupInfo.setRoles(roles);
  nodeGroupInfo.setConfiguration(configuration);
  if (haFlag != null && (haFlag.equalsIgnoreCase(Constants.HA_FLAG_FT) || haFlag.equalsIgnoreCase(Constants.HA_FLAG_ON))) {
    nodeGroupInfo.setHaEnabled(true);
  }
  nodeGroupInfo.setInstanceType(instanceType);
  nodeGroupInfo.setPlacement(placementPolicies);
  if (storage != null) {
    nodeGroupInfo.setStorageSize(storage.getSizeGB());
    nodeGroupInfo.setStorageType(storage.getType());
  }
  nodeGroupInfo.setNodes(null);
  return nodeGroupInfo;
}
Program: 48593
Project: 48593
Buggy source:
@Override public void afterPropertiesSet() throws Exception {
  List<ClusterEntity> clusters=lockedEntityManager.getClusterEntityMgr().findAllClusters();
  for (  ClusterEntity cluster : clusters) {
    requestQueue.add(cluster.getName());
    logger.info("String_Node_Str" + cluster.getName());
  }
  syncupTimer=new Timer(SERVICE_SYNCUP_THREAD_NAME,true);
  StatusSyncUpTask task=new StatusSyncUpTask(lockedEntityManager,softwareManagerCollector,requestQueue);
  syncupTimer.schedule(task,SYNCUP_INTERVAL_MILLISECONDS);
}

Fixed version (ground truth):
@Override public void afterPropertiesSet() throws Exception {
  List<ClusterEntity> clusters=lockedEntityManager.getClusterEntityMgr().findAllClusters();
  for (  ClusterEntity cluster : clusters) {
    requestQueue.add(cluster.getName());
    logger.info("String_Node_Str" + cluster.getName());
  }
  syncupTimer=new Timer(SERVICE_SYNCUP_THREAD_NAME,true);
  StatusSyncUpTask task=new StatusSyncUpTask(lockedEntityManager,softwareManagerCollector,requestQueue);
  syncupTimer.scheduleAtFixedRate(task,new Date(),SYNCUP_INTERVAL_MILLISECONDS);
}
Program: 48595
Project: 48595
Buggy source:
@Override public Void call() throws Exception {
  vcVm=VcCache.getIgnoreMissing(vmId);
  if (vcVm == null) {
    logger.info("String_Node_Str" + vmId + "String_Node_Str");
    return null;
  }
  VcContext.inVcSessionDo(new VcSession<Void>(){
    @Override protected Void body() throws Exception {
      try {
        FaultToleranceConfigInfo info=vcVm.getConfig().getFtInfo();
        if (info != null && info.getRole() == 1) {
          logger.info("String_Node_Str" + vcVm.getName() + "String_Node_Str");
          vcVm.turnOffFT();
        }
        if (vcVm.isPoweredOn()) {
          vcVm.powerOff();
        }
        vcVm.destroy();
        return null;
      }
 catch (      ManagedObjectNotFound e) {
        VcUtil.processNotFoundException(e,vmId,logger);
        return null;
      }
catch (      Exception e) {
        if (vcVm.getConnectionState() == ConnectionState.inaccessible) {
          logger.error("String_Node_Str" + vcVm.getName(),e);
          logger.info("String_Node_Str" + vcVm.getName());
          vcVm.unregister();
          return null;
        }
 else {
          throw e;
        }
      }
    }
    protected boolean isTaskSession(){
      return true;
    }
  }
);
  return null;
}

Fixed version (ground truth):
@Override public Void call() throws Exception {
  vcVm=VcCache.getIgnoreMissing(vmId);
  if (vcVm == null) {
    logger.info("String_Node_Str" + vmId + "String_Node_Str");
    return null;
  }
  VcContext.inVcSessionDo(new VcSession<Void>(){
    @Override protected Void body() throws Exception {
      try {
        FaultToleranceConfigInfo info=vcVm.getConfig().getFtInfo();
        if (info != null && info.getRole() == 1) {
          logger.info("String_Node_Str" + vcVm.getName() + "String_Node_Str");
          vcVm.turnOffFT();
        }
        if (vcVm.isPoweredOn()) {
          vcVm.powerOff();
        }
        vcVm.destroy();
        return null;
      }
 catch (      ManagedObjectNotFound e) {
        VcUtil.processNotFoundException(e,vmId,logger);
        return null;
      }
catch (      Exception e) {
        if (e.getCause() != null && e.getCause() instanceof ManagedObjectNotFound) {
          VcUtil.processNotFoundException((ManagedObjectNotFound)e.getCause(),vmId,logger);
          return null;
        }
        if (vcVm.getConnectionState() == ConnectionState.inaccessible) {
          logger.error("String_Node_Str" + vcVm.getName(),e);
          logger.info("String_Node_Str" + vcVm.getName());
          vcVm.unregister();
          return null;
        }
 else {
          throw e;
        }
      }
    }
    protected boolean isTaskSession(){
      return true;
    }
  }
);
  return null;
}
Program: 48596
Project: 48596
Buggy source:
@Override protected Void body() throws Exception {
  try {
    FaultToleranceConfigInfo info=vcVm.getConfig().getFtInfo();
    if (info != null && info.getRole() == 1) {
      logger.info("String_Node_Str" + vcVm.getName() + "String_Node_Str");
      vcVm.turnOffFT();
    }
    if (vcVm.isPoweredOn()) {
      vcVm.powerOff();
    }
    vcVm.destroy();
    return null;
  }
 catch (  ManagedObjectNotFound e) {
    VcUtil.processNotFoundException(e,vmId,logger);
    return null;
  }
catch (  Exception e) {
    if (vcVm.getConnectionState() == ConnectionState.inaccessible) {
      logger.error("String_Node_Str" + vcVm.getName(),e);
      logger.info("String_Node_Str" + vcVm.getName());
      vcVm.unregister();
      return null;
    }
 else {
      throw e;
    }
  }
}

Fixed version (ground truth):
@Override protected Void body() throws Exception {
  try {
    FaultToleranceConfigInfo info=vcVm.getConfig().getFtInfo();
    if (info != null && info.getRole() == 1) {
      logger.info("String_Node_Str" + vcVm.getName() + "String_Node_Str");
      vcVm.turnOffFT();
    }
    if (vcVm.isPoweredOn()) {
      vcVm.powerOff();
    }
    vcVm.destroy();
    return null;
  }
 catch (  ManagedObjectNotFound e) {
    VcUtil.processNotFoundException(e,vmId,logger);
    return null;
  }
catch (  Exception e) {
    if (e.getCause() != null && e.getCause() instanceof ManagedObjectNotFound) {
      VcUtil.processNotFoundException((ManagedObjectNotFound)e.getCause(),vmId,logger);
      return null;
    }
    if (vcVm.getConnectionState() == ConnectionState.inaccessible) {
      logger.error("String_Node_Str" + vcVm.getName(),e);
      logger.info("String_Node_Str" + vcVm.getName());
      vcVm.unregister();
      return null;
    }
 else {
      throw e;
    }
  }
}
Program: 48597
Project: 48597
Buggy source:
public boolean inStableStatus(){
  ClusterStatus[] stableStatus=new ClusterStatus[]{ClusterStatus.RUNNING,ClusterStatus.STOPPED,ClusterStatus.CONFIGURE_ERROR,ClusterStatus.ERROR,ClusterStatus.PROVISION_ERROR};
  return Arrays.asList(stableStatus).contains(this.status);
}

Fixed version (ground truth):
public boolean inStableStatus(){
  ClusterStatus[] stableStatus=new ClusterStatus[]{ClusterStatus.RUNNING,ClusterStatus.STOPPED,ClusterStatus.CONFIGURE_ERROR,ClusterStatus.ERROR,ClusterStatus.PROVISION_ERROR,ClusterStatus.SERVICE_ERROR};
  return Arrays.asList(stableStatus).contains(this.status);
}
Program: 48598
Project: 48598
Buggy source:
@Transactional @RetryTransaction public boolean handleOperationStatus(String clusterName,ClusterReport report,boolean lastUpdate){
  boolean finished=report.isFinished();
  ClusterEntity cluster=findByName(report.getName());
  Map<String,NodeReport> nodeReportMap=report.getNodeReports();
  for (  NodeGroupEntity group : cluster.getNodeGroups()) {
    for (    NodeEntity node : group.getNodes()) {
      NodeReport nodeReport=nodeReportMap.get(node.getVmName());
      if (nodeReport == null) {
        continue;
      }
      if (nodeReport.getStatus() != null) {
        logger.debug("String_Node_Str" + node.getVmName() + "String_Node_Str"+ node.getStatus()+ "String_Node_Str"+ nodeReport.getStatus().toString());
        if (!node.isDisconnected()) {
          if (nodeReport.getStatus() == ServiceStatus.RUNNING) {
            node.setStatus(NodeStatus.SERVICE_READY);
          }
 else {
            node.setStatus(NodeStatus.BOOTSTRAP_FAILED);
          }
        }
      }
      if (nodeReport.isUseClusterMsg() && report.getAction() != null) {
        logger.debug("String_Node_Str" + report.getAction());
        node.setAction(report.getAction());
      }
 else       if (nodeReport.getAction() != null) {
        node.setAction(nodeReport.getAction());
      }
      if (nodeReport.getErrMsg() != null) {
        logger.debug("String_Node_Str" + report.getAction());
        node.setErrMessage(nodeReport.getErrMsg());
      }
    }
  }
  return finished;
}

Fixed version (ground truth):
@Transactional @RetryTransaction public boolean handleOperationStatus(String clusterName,ClusterReport report,boolean lastUpdate){
  boolean finished=report.isFinished();
  ClusterEntity cluster=findByName(report.getName());
  Map<String,NodeReport> nodeReportMap=report.getNodeReports();
  for (  NodeGroupEntity group : cluster.getNodeGroups()) {
    for (    NodeEntity node : group.getNodes()) {
      NodeReport nodeReport=nodeReportMap.get(node.getVmName());
      if (nodeReport == null) {
        continue;
      }
      if (nodeReport.getStatus() != null) {
        logger.debug("String_Node_Str" + node.getVmName() + "String_Node_Str"+ node.getStatus()+ "String_Node_Str"+ nodeReport.getStatus().toString());
        if (!node.isDisconnected()) {
          if (nodeReport.getStatus() == ServiceStatus.RUNNING) {
            node.setStatus(NodeStatus.SERVICE_READY);
          }
 else {
            node.setStatus(NodeStatus.BOOTSTRAP_FAILED);
          }
        }
      }
      if (nodeReport.isUseClusterMsg() && report.getAction() != null) {
        logger.debug("String_Node_Str" + report.getAction());
        node.setAction(report.getAction());
      }
 else       if (nodeReport.getAction() != null) {
        node.setAction(nodeReport.getAction());
      }
      if (lastUpdate && nodeReport.getErrMsg() != null) {
        logger.debug("String_Node_Str" + report.getAction());
        node.setErrMessage(nodeReport.getErrMsg());
      }
    }
  }
  return finished;
}
Program: 48599
Project: 48599
Buggy source:
@Override public void run(){
  Set<String> clusterList=new HashSet<String>();
  requestQueue.drainTo(clusterList);
  if (clusterList.isEmpty()) {
    logger.debug("String_Node_Str");
    return;
  }
  try {
    Iterator<String> ite=clusterList.iterator();
    for (String clusterName=ite.next(); ite.hasNext(); ) {
      ClusterEntity cluster=lockedEntityManager.getClusterEntityMgr().findByName(clusterName);
      if (cluster == null) {
        logger.info("String_Node_Str" + clusterName + "String_Node_Str");
        ite.remove();
        continue;
      }
      if (!cluster.inStableStatus()) {
        logger.debug("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.inStableStatus());
        logger.debug("String_Node_Str");
        continue;
      }
      ClusterBlueprint blueprint=lockedEntityManager.getClusterEntityMgr().toClusterBluePrint(clusterName);
      SoftwareManager softMgr=softwareManagerCollector.getSoftwareManagerByClusterName(clusterName);
      if (softMgr == null) {
        logger.error("String_Node_Str" + clusterName + "String_Node_Str");
        continue;
      }
      ClusterReport report=softMgr.queryClusterStatus(blueprint);
      if (report == null) {
        logger.debug("String_Node_Str");
        continue;
      }
      setClusterStatus(clusterName,report);
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + e.getMessage(),e);
  }
  requestQueue.addAll(clusterList);
}

Fixed version (ground truth):
@Override public void run(){
  Set<String> clusterList=new HashSet<String>();
  requestQueue.drainTo(clusterList);
  if (clusterList.isEmpty()) {
    logger.debug("String_Node_Str");
    return;
  }
  Iterator<String> ite=clusterList.iterator();
  for (String clusterName=ite.next(); ite.hasNext(); clusterName=ite.next()) {
    try {
      ClusterEntity cluster=lockedEntityManager.getClusterEntityMgr().findByName(clusterName);
      if (cluster == null) {
        logger.info("String_Node_Str" + clusterName + "String_Node_Str");
        ite.remove();
        continue;
      }
      if (!cluster.inStableStatus()) {
        logger.debug("String_Node_Str" + clusterName + "String_Node_Str"+ cluster.inStableStatus());
        logger.debug("String_Node_Str");
        continue;
      }
      ClusterBlueprint blueprint=lockedEntityManager.getClusterEntityMgr().toClusterBluePrint(clusterName);
      SoftwareManager softMgr=softwareManagerCollector.getSoftwareManagerByClusterName(clusterName);
      if (softMgr == null) {
        logger.error("String_Node_Str" + clusterName + "String_Node_Str");
        continue;
      }
      ClusterReport report=softMgr.queryClusterStatus(blueprint);
      if (report == null) {
        logger.debug("String_Node_Str");
        continue;
      }
      lockedEntityManager.getClusterEntityMgr().setClusterStatus(clusterName,report);
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + clusterName + "String_Node_Str"+ e.getMessage(),e);
    }
  }
  requestQueue.addAll(clusterList);
}
Program: 48600
Project: 48600
Buggy source:
@Override public AmHealthState getClusterStatus(String clusterName){
  String fields="String_Node_Str";
  String servicesWithState=apiResourceRootV1.getClustersResource().getComponentsResource(clusterName).readComponentsWithFilter(fields);
  ApiComponentList componentList=ApiUtils.jsonToObject(ApiComponentList.class,servicesWithState);
  AmHealthState state=AmHealthState.HEALTHY;
  if (componentList.getApiComponents() != null) {
    for (    ApiServiceComponent component : componentList.getApiComponents()) {
      ApiServiceComponentInfo info=component.getApiServiceComponent();
      if (info.getCategory().equalsIgnoreCase("String_Node_Str") && (!ComponentStatus.INSTALLED.toString().equalsIgnoreCase(info.getState()))) {
        state=AmHealthState.UNHEALTHY;
      }
 else       if ((!info.getCategory().equalsIgnoreCase("String_Node_Str")) && (!ComponentStatus.STARTED.toString().equalsIgnoreCase(info.getState()))) {
        state=AmHealthState.UNHEALTHY;
      }
    }
  }
  return state;
}

Fixed version (ground truth):
@Override public AmHealthState getClusterStatus(String clusterName){
  String fields="String_Node_Str";
  String servicesWithState=null;
  servicesWithState=apiResourceRootV1.getClustersResource().getComponentsResource(clusterName).readComponentsWithFilter(fields);
  ApiComponentList componentList=ApiUtils.jsonToObject(ApiComponentList.class,servicesWithState);
  AmHealthState state=AmHealthState.HEALTHY;
  if (componentList.getApiComponents() != null) {
    for (    ApiServiceComponent component : componentList.getApiComponents()) {
      ApiServiceComponentInfo info=component.getApiServiceComponent();
      if (info.getCategory().equalsIgnoreCase("String_Node_Str") && (!ComponentStatus.INSTALLED.toString().equalsIgnoreCase(info.getState()))) {
        state=AmHealthState.UNHEALTHY;
      }
 else       if ((!info.getCategory().equalsIgnoreCase("String_Node_Str")) && (!ComponentStatus.STARTED.toString().equalsIgnoreCase(info.getState()))) {
        state=AmHealthState.UNHEALTHY;
      }
    }
  }
  return state;
}
Program: 48601
Project: 48601
Buggy source:
@Override public ClusterReport queryClusterStatus(ClusterBlueprint blueprint){
  AmClusterDef clusterDef=new AmClusterDef(blueprint,privateKey);
  AmHealthState state=apiManager.getClusterStatus(blueprint.getName());
  if (AmHealthState.HEALTHY == state) {
    clusterDef.getCurrentReport().setStatus(ServiceStatus.RUNNING);
  }
 else {
    clusterDef.getCurrentReport().setStatus(ServiceStatus.FAILED);
  }
  Map<String,AmHealthState> hostStates=apiManager.getHostStatus(blueprint.getName());
  Map<String,NodeReport> nodeReports=clusterDef.getCurrentReport().getNodeReports();
  for (  AmNodeDef node : clusterDef.getNodes()) {
    String fqdn=node.getFqdn();
    AmHealthState health=hostStates.get(fqdn);
    if (AmHealthState.HEALTHY == health) {
      nodeReports.get(node.getName()).setStatus(ServiceStatus.RUNNING);
    }
 else {
      nodeReports.get(node.getName()).setStatus(ServiceStatus.FAILED);
    }
  }
  return clusterDef.getCurrentReport().clone();
}

Fixed version (ground truth):
@Override public ClusterReport queryClusterStatus(ClusterBlueprint blueprint){
  AmClusterDef clusterDef=new AmClusterDef(blueprint,privateKey);
  try {
    AmHealthState state=apiManager.getClusterStatus(blueprint.getName());
    if (AmHealthState.HEALTHY == state) {
      clusterDef.getCurrentReport().setStatus(ServiceStatus.RUNNING);
    }
 else {
      clusterDef.getCurrentReport().setStatus(ServiceStatus.FAILED);
    }
    Map<String,AmHealthState> hostStates=apiManager.getHostStatus(blueprint.getName());
    Map<String,NodeReport> nodeReports=clusterDef.getCurrentReport().getNodeReports();
    for (    AmNodeDef node : clusterDef.getNodes()) {
      String fqdn=node.getFqdn();
      AmHealthState health=hostStates.get(fqdn);
      if (AmHealthState.HEALTHY == health) {
        nodeReports.get(node.getName()).setStatus(ServiceStatus.RUNNING);
      }
 else {
        nodeReports.get(node.getName()).setStatus(ServiceStatus.FAILED);
      }
    }
  }
 catch (  NotFoundException e) {
    logger.info("String_Node_Str" + blueprint.getName() + "String_Node_Str");
    return null;
  }
  return clusterDef.getCurrentReport().clone();
}
Program: 48603
Project: 48603
Buggy source:
@Override public boolean poll(){
  ClusterReport toReport=null;
synchronized (currentReport) {
    if (!reported) {
      int currentProgress=currentReport.getProgress();
      int toProgress=currentProgress + (endProgress - currentProgress) / leftStepsNum;
      currentReport.setProgress(toProgress > endProgress ? endProgress : toProgress);
      leftStepsNum-=1;
      toReport=currentReport.clone();
      reported=true;
    }
  }
  if (toReport != null) {
    logger.info("String_Node_Str" + toReport.getProgress() + "String_Node_Str"+ toReport.getAction());
    reportQueue.addClusterReport(toReport);
  }
  if (rootResource.getCommandsResource().readCommand(parentCmdId).getEndTime() != null) {
    running=false;
    executor.shutdown();
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean poll(){
  ClusterReport toReport=null;
synchronized (currentReport) {
    if (!reported) {
      if (leftStepsNum == 0) {
        currentReport.setProgress(endProgress);
      }
 else {
        int currentProgress=currentReport.getProgress();
        int toProgress=currentProgress + (endProgress - currentProgress) / leftStepsNum;
        currentReport.setProgress(toProgress > endProgress ? endProgress : toProgress);
        leftStepsNum-=1;
      }
      toReport=currentReport.clone();
      reported=true;
    }
  }
  if (toReport != null) {
    logger.info("String_Node_Str" + toReport.getProgress() + "String_Node_Str"+ toReport.getAction());
    reportQueue.addClusterReport(toReport);
  }
  if (rootResource.getCommandsResource().readCommand(parentCmdId).getEndTime() != null) {
    running=false;
    executor.shutdown();
    return true;
  }
  return false;
}
Program: 48606
Project: 48606
Buggy source:
@Override public void syncUp(String clusterName){
  StatusSyncUpRequest request=new StatusSyncUpRequest(clusterName,lockedEntityManager,softwareManagerCollector,this,WorkQueue.CUSTOM_FIVE_MIN_SYNC_DELAY);
  CmsWorker.addPeriodic(request);
  inQueueCluster.add(clusterName);
}

Fixed version (ground truth):
@Override public void syncUp(String clusterName){
  requestQueue.add(clusterName);
}
Program: 48607
Project: 48607
Buggy source:
@Override public void afterPropertiesSet() throws Exception {
  List<ClusterEntity> clusters=lockedEntityManager.getClusterEntityMgr().findAllClusters();
  for (  ClusterEntity cluster : clusters) {
    syncUp(cluster.getName());
    logger.info("String_Node_Str" + cluster.getName());
  }
}

Fixed version (ground truth):
@Override public void afterPropertiesSet() throws Exception {
  List<ClusterEntity> clusters=lockedEntityManager.getClusterEntityMgr().findAllClusters();
  for (  ClusterEntity cluster : clusters) {
    requestQueue.add(cluster.getName());
    logger.info("String_Node_Str" + cluster.getName());
  }
  syncupTimer=new Timer(SERVICE_SYNCUP_THREAD_NAME,true);
  StatusSyncUpTask task=new StatusSyncUpTask(lockedEntityManager,softwareManagerCollector,requestQueue);
  syncupTimer.schedule(task,SYNCUP_INTERVAL_MILLISECONDS);
}
Program: 48609
Project: 48609
Buggy source:
@Override public Set<String> getSupportedRoles() throws SoftwareManagementPluginException {
  return null;
}

Fixed version (ground truth):
@Override public Set<String> getSupportedRoles(HadoopStack hadoopStack) throws SoftwareManagementPluginException {
  return null;
}
Program: 48610
Project: 48610
Buggy source:
@Override public List<HadoopStack> getSupportedStacks() throws SoftwareManagementPluginException {
  List<HadoopStack> hadoopStacks=new ArrayList<HadoopStack>();
  ApiStackList stackList=apiManager.stackList();
  for (  ApiStack apiStack : stackList.getApiStacks()) {
    for (    ApiStackVersion apiStackVersionSummary : apiManager.stackVersionList(apiStack.getApiStackName().getStackName()).getApiStackVersions()) {
      ApiStackVersionInfo apiStackVersionInfoSummary=apiStackVersionSummary.getApiStackVersionInfo();
      ApiStackVersion apiStackVersion=apiManager.stackVersion(apiStackVersionInfoSummary.getStackName(),apiStackVersionInfoSummary.getStackVersion());
      ApiStackVersionInfo apiStackVersionInfo=apiStackVersion.getApiStackVersionInfo();
      if (apiStackVersionInfo.isActive()) {
        HadoopStack hadoopStack=new HadoopStack();
        hadoopStack.setDistroName(apiStackVersionInfo.getStackName(),apiStackVersionInfo.getStackVersion());
        hadoopStack.setFullVersion(apiStackVersionInfo.getStackVersion());
        hadoopStack.setVendor(apiStackVersionInfo.getStackName());
        hadoopStacks.add(hadoopStack);
      }
    }
  }
  return hadoopStacks;
}

Fixed version (ground truth):
@Override public List<HadoopStack> getSupportedStacks() throws SoftwareManagementPluginException {
  List<HadoopStack> hadoopStacks=new ArrayList<HadoopStack>();
  ApiStackList stackList=apiManager.stackList();
  for (  ApiStack apiStack : stackList.getApiStacks()) {
    for (    ApiStackVersion apiStackVersionSummary : apiManager.stackVersionList(apiStack.getApiStackName().getStackName()).getApiStackVersions()) {
      ApiStackVersionInfo apiStackVersionInfoSummary=apiStackVersionSummary.getApiStackVersionInfo();
      ApiStackVersion apiStackVersion=apiManager.stackVersion(apiStackVersionInfoSummary.getStackName(),apiStackVersionInfoSummary.getStackVersion());
      ApiStackVersionInfo apiStackVersionInfo=apiStackVersion.getApiStackVersionInfo();
      if (apiStackVersionInfo.isActive()) {
        HadoopStack hadoopStack=new HadoopStack();
        hadoopStack.setDistro(apiStackVersionInfo.getStackName(),apiStackVersionInfo.getStackVersion());
        hadoopStack.setFullVersion(apiStackVersionInfo.getStackVersion());
        hadoopStack.setVendor(apiStackVersionInfo.getStackName());
        hadoopStacks.add(hadoopStack);
      }
    }
  }
  return hadoopStacks;
}
Program: 48611
Project: 48611
Buggy source:
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void addAppManager(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String name,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String description,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String type,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String url,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String username,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String password,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String path){
  try {
    AppManagerAdd appManagerAdd=new AppManagerAdd();
    appManagerAdd.setName(name);
    appManagerAdd.setDescription(description);
    appManagerAdd.setType(type);
    appManagerAdd.setUrl(url);
    appManagerAdd.setUsername(username);
    appManagerAdd.setPassword(password);
    appManagerAdd.setSslCertificate(CommandsUtils.dataFromFile(path));
    restClient.add(appManagerAdd);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_APPMANAGER,name,Constants.OUTPUT_OP_RESULT_ADD);
  }
 catch (  Exception e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_APPMANAGER,name,Constants.OUTPUT_OP_ADD,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}

Fixed version (ground truth):
@CliCommand(value="String_Node_Str",help="String_Node_Str") public void addAppManager(@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String name,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String description,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String type,@CliOption(key={"String_Node_Str"},mandatory=true,help="String_Node_Str") final String url,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String username,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String password,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final String path){
  try {
    AppManagerAdd appManagerAdd=new AppManagerAdd();
    appManagerAdd.setName(name);
    appManagerAdd.setDescription(description);
    appManagerAdd.setType(type);
    appManagerAdd.setUrl(url);
    appManagerAdd.setUsername(username);
    appManagerAdd.setPassword(password);
    appManagerAdd.setSslCertificate(CommandsUtils.dataFromFile(path));
    restClient.add(appManagerAdd);
    CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_APPMANAGER,name,Constants.OUTPUT_OP_RESULT_ADD);
  }
 catch (  Exception e) {
    CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_APPMANAGER,name,Constants.OUTPUT_OP_ADD,Constants.OUTPUT_OP_RESULT_FAIL,e.getMessage());
  }
}