nus-yam/ex-repair huggingface dataset:
Program: 116394
Project: 116394
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().activateTenant(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().activateTenant(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116395
Project: 116395
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 2) {
    String alias=args[0];
    String domain=args[1];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",domain,alias);
    }
    String domainToDisplay=null;
    domainToDisplay=CommandLineService.getInstance().addDomainMapping(domain,alias);
    if (StringUtils.isBlank(domainToDisplay)) {
      System.out.println("String_Node_Str");
      return CliConstants.COMMAND_FAILED;
    }
 else {
      System.out.format("String_Node_Str",domainToDisplay);
      return CliConstants.COMMAND_SUCCESSFULL;
    }
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 2) {
    String alias=args[0];
    String domain=args[1];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",domain,alias);
    }
    String domainToDisplay=null;
    domainToDisplay=CommandLineService.getInstance().addDomainMapping(domain,alias);
    if (StringUtils.isBlank(domainToDisplay)) {
      System.out.println("String_Node_Str");
      return CliConstants.COMMAND_FAILED;
    }
 else {
      System.out.format("String_Node_Str",domainToDisplay);
      return CliConstants.COMMAND_SUCCESSFULL;
    }
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116397
Project: 116397
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().deactivateTenant(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().deactivateTenant(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116398
Project: 116398
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().deleteTenant(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().deleteTenant(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116399
Project: 116399
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().describeAutoScalingPolicy(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().describeAutoScalingPolicy(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116400
Project: 116400
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().describeAvailableCartridges(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().describeAvailableCartridges(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116401
Project: 116401
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().describeDeploymentPolicy(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().describeDeploymentPolicy(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116402
Project: 116402
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().describePartition(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String id=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",id);
    }
    RestCommandLineService.getInstance().describePartition(id);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116403
Project: 116403
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116404
Project: 116404
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    context.getStratosApplication().printHelp();
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else   if (args != null && args.length == 1) {
    context.getStratosApplication().printHelp(args[0]);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    context.getStratosApplication().printHelp();
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else   if (args != null && args.length == 1) {
    context.getStratosApplication().printHelp(args[0]);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116405
Project: 116405
Buggy source:
@Override public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String alias=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",alias);
    }
    CommandLineService.getInstance().info(alias);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
@Override public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args != null && args.length == 1) {
    String alias=args[0];
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",alias);
    }
    CommandLineService.getInstance().info(alias);
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116406
Project: 116406
Buggy source:
public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    RestCommandLineService.getInstance().listAllTenants();
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    RestCommandLineService.getInstance().listAllTenants();
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116407
Project: 116407
Buggy source:
public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    RestCommandLineService.getInstance().listCartridges();
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    RestCommandLineService.getInstance().listCartridges();
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116408
Project: 116408
Buggy source:
public int execute(StratosCommandContext context,String[] args,Option[] already_parsed_opts) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    RestCommandLineService.getInstance().listServices();
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}

Fixed version (ground truth):
public int execute(StratosCommandContext context,String[] args) throws CommandException {
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",getName());
  }
  if (args == null || args.length == 0) {
    RestCommandLineService.getInstance().listServices();
    return CliConstants.COMMAND_SUCCESSFULL;
  }
 else {
    context.getStratosApplication().printUsage(getName());
    return CliConstants.COMMAND_FAILED;
  }
}
Program: 116409
Project: 116409
Buggy source:
public PartitionContext(Partition partition){
  this.setPartition(partition);
  this.minimumMemberCount=partition.getPartitionMin();
  this.partitionId=partition.getId();
  this.pendingMembers=new ArrayList<MemberContext>();
  this.activeMembers=new ArrayList<MemberContext>();
  this.terminationPendingMembers=new ArrayList<MemberContext>();
  this.obsoletedMembers=new CopyOnWriteArrayList<String>();
  memberStatsContexts=new ConcurrentHashMap<String,MemberStatsContext>();
  XMLConfiguration conf=ConfUtil.getInstance(null).getConfiguration();
  expiryTime=conf.getLong("String_Node_Str",900000);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + expiryTime);
  }
  Thread th=new Thread(new PendingMemberWatcher(this));
  th.start();
}

Fixed version (ground truth):
public PartitionContext(Partition partition){
  this.setPartition(partition);
  this.minimumMemberCount=partition.getPartitionMin();
  this.partitionId=partition.getId();
  this.pendingMembers=new CopyOnWriteArrayList<MemberContext>();
  this.activeMembers=new CopyOnWriteArrayList<MemberContext>();
  this.terminationPendingMembers=new CopyOnWriteArrayList<MemberContext>();
  this.obsoletedMembers=new CopyOnWriteArrayList<String>();
  memberStatsContexts=new ConcurrentHashMap<String,MemberStatsContext>();
  XMLConfiguration conf=ConfUtil.getInstance(null).getConfiguration();
  expiryTime=conf.getLong("String_Node_Str",900000);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + expiryTime);
  }
  Thread th=new Thread(new PendingMemberWatcher(this));
  th.start();
}
Program: 116410
Project: 116410
Buggy source:
public void setStatus(ClusterStatus status){
  log.info(String.format("String_Node_Str" + "String_Node_Str",clusterId,this.status,status));
  this.status=status;
  if (status == ClusterStatus.Inactive && !this.hasDependent) {
    log.info("String_Node_Str" + clusterId + "String_Node_Str"+ "String_Node_Str");
  }
 else   if (status == ClusterStatus.Terminating) {
    log.info("String_Node_Str" + clusterId + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,this.status,this.clusterId);
  }
}

Fixed version (ground truth):
public void setStatus(ClusterStatus status){
  this.status=status;
  if (status == ClusterStatus.Inactive && !this.hasDependent) {
    log.info("String_Node_Str" + clusterId + "String_Node_Str"+ "String_Node_Str");
  }
 else   if (status == ClusterStatus.Terminating) {
    log.info("String_Node_Str" + clusterId + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,this.status,this.clusterId);
  }
}
Program: 116411
Project: 116411
Buggy source:
/** 
 * Will set the status of the monitor based on Topology Group status/child status like scaling
 * @param status
 */
public void setStatus(GroupStatus status){
  log.info(String.format("String_Node_Str" + "String_Node_Str",id,this.status,status));
  this.status=status;
  if (status == GroupStatus.Inactive && !this.hasDependent) {
    log.info("String_Node_Str" + this.id + "String_Node_Str"+ "String_Node_Str");
  }
 else   if (status == GroupStatus.Terminating) {
    log.info("String_Node_Str" + this.id + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    MonitorStatusEventBuilder.handleGroupStatusEvent(this.parent,this.status,this.id);
  }
  MonitorStatusEventBuilder.notifyChildren(this.parent,new GroupStatusEvent(status,getId()));
}

Fixed version (ground truth):
/** 
 * Will set the status of the monitor based on Topology Group status/child status like scaling
 * @param status
 */
public void setStatus(GroupStatus status){
  this.status=status;
  if (status == GroupStatus.Inactive && !this.hasDependent) {
    log.info("String_Node_Str" + this.id + "String_Node_Str"+ "String_Node_Str");
  }
 else   if (status == GroupStatus.Terminating) {
    log.info("String_Node_Str" + this.id + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    MonitorStatusEventBuilder.handleGroupStatusEvent(this.parent,this.status,this.id);
  }
  MonitorStatusEventBuilder.notifyChildren(this.parent,new GroupStatusEvent(status,getId()));
}
Program: 116412
Project: 116412
Buggy source:
public boolean isSubscriptionDomainValid(String domainName) throws ADCException {
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",domainName));
    }
    org.wso2.carbon.user.core.tenant.TenantManager tenantManager=DataHolder.getRealmService().getTenantManager();
    org.wso2.carbon.user.api.Tenant[] tenants=tenantManager.getAllTenants();
    if ((tenants != null) && (tenants.length > 0)) {
      DataInsertionAndRetrievalManager manager=new DataInsertionAndRetrievalManager();
      for (      org.wso2.carbon.user.api.Tenant tenant : tenants) {
        if (log.isDebugEnabled()) {
          log.debug(String.format("String_Node_Str",tenant.getId(),tenant.getDomain()));
        }
        Collection<CartridgeSubscription> subscriptions=manager.getCartridgeSubscriptions(tenant.getId());
        if (subscriptions == null) {
          continue;
        }
        for (        CartridgeSubscription subscription : subscriptions) {
          if (log.isDebugEnabled()) {
            log.debug(String.format("String_Node_Str",subscription.getAlias(),subscription.getSubscriptionDomains()));
          }
          if (subscription.subscriptionDomainExists(domainName)) {
            return false;
          }
        }
      }
    }
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",domainName));
    }
    return true;
  }
 catch (  Exception e) {
    String errorMsg="String_Node_Str" + domainName;
    log.error(errorMsg);
    throw new ADCException(errorMsg,e);
  }
}

Fixed version (ground truth):
public static boolean isSubscriptionDomainValid(String domainName) throws ADCException {
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",domainName));
    }
    org.wso2.carbon.user.core.tenant.TenantManager tenantManager=DataHolder.getRealmService().getTenantManager();
    org.wso2.carbon.user.api.Tenant[] tenants=tenantManager.getAllTenants();
    if ((tenants != null) && (tenants.length > 0)) {
      DataInsertionAndRetrievalManager manager=new DataInsertionAndRetrievalManager();
      for (      org.wso2.carbon.user.api.Tenant tenant : tenants) {
        if (log.isDebugEnabled()) {
          log.debug(String.format("String_Node_Str",tenant.getId(),tenant.getDomain()));
        }
        Collection<CartridgeSubscription> subscriptions=manager.getCartridgeSubscriptions(tenant.getId());
        if (subscriptions == null) {
          continue;
        }
        for (        CartridgeSubscription subscription : subscriptions) {
          if (log.isDebugEnabled()) {
            log.debug(String.format("String_Node_Str",subscription.getAlias(),subscription.getSubscriptionDomains()));
          }
          if (subscription.subscriptionDomainExists(domainName)) {
            return false;
          }
        }
      }
    }
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",domainName));
    }
    return true;
  }
 catch (  Exception e) {
    String errorMsg="String_Node_Str" + domainName;
    log.error(errorMsg);
    throw new ADCException(errorMsg,e);
  }
}
Program: 116413
Project: 116413
Buggy source:
private Properties getPersistenceMappingProperties(PersistenceContext persistenceCtxt,CartridgeInfo cartridgeInfo) throws ADCException {
  if (!cartridgeInfo.isPersistenceSpecified()) {
    String errorMsg="String_Node_Str" + cartridgeInfo.getType();
    log.error(errorMsg);
    throw new ADCException(errorMsg);
  }
  Properties persistenceMappingProperties=new Properties();
  persistenceMappingProperties.setProperties(new Property[]{persistenceCtxt.getPersistanceRequiredProperty(),persistenceCtxt.getSizeProperty(),persistenceCtxt.getDeleteOnTerminationProperty(),persistenceCtxt.getVolumeIdProperty()});
  return persistenceMappingProperties;
}

Fixed version (ground truth):
private static Properties getPersistenceMappingProperties(PersistenceContext persistenceCtxt,CartridgeInfo cartridgeInfo) throws ADCException {
  if (!cartridgeInfo.isPersistenceSpecified()) {
    String errorMsg="String_Node_Str" + cartridgeInfo.getType();
    log.error(errorMsg);
    throw new ADCException(errorMsg);
  }
  Properties persistenceMappingProperties=new Properties();
  persistenceMappingProperties.setProperties(new Property[]{persistenceCtxt.getPersistanceRequiredProperty(),persistenceCtxt.getSizeProperty(),persistenceCtxt.getDeleteOnTerminationProperty(),persistenceCtxt.getVolumeIdProperty()});
  return persistenceMappingProperties;
}
Program: 116414
Project: 116414
Buggy source:
public CartridgeSubscription getCartridgeSubscription(int tenantId,String subscriptionAlias){
  return new DataInsertionAndRetrievalManager().getCartridgeSubscription(tenantId,subscriptionAlias);
}

Fixed version (ground truth):
public static CartridgeSubscription getCartridgeSubscription(int tenantId,String subscriptionAlias){
  return new DataInsertionAndRetrievalManager().getCartridgeSubscription(tenantId,subscriptionAlias);
}
Program: 116416
Project: 116416
Buggy source:
private GroupStatus getGroupStatus(Map<String,Group> groups){
  GroupStatus status=null;
  boolean groupActive=true;
  boolean groupTerminated=true;
  boolean groupCreated=true;
  for (  Group group : groups.values()) {
    if (group.getStatus() == GroupStatus.Active) {
      groupActive=groupActive && true;
      groupTerminated=false;
      groupCreated=false;
    }
 else     if (group.getStatus() == GroupStatus.Inactive) {
      status=GroupStatus.Inactive;
      break;
    }
 else     if (group.getStatus() == GroupStatus.Terminated) {
      groupActive=false;
      groupCreated=false;
      groupTerminated=groupTerminated && true;
    }
 else     if (group.getStatus() == GroupStatus.Created) {
      groupActive=false;
      groupTerminated=false;
      groupCreated=groupCreated && true;
    }
 else     if (group.getStatus() == GroupStatus.Terminating) {
      groupActive=false;
      groupTerminated=false;
      groupCreated=false;
      status=GroupStatus.Terminating;
    }
  }
  if (groupActive) {
    status=GroupStatus.Active;
  }
 else   if (groupTerminated) {
    status=GroupStatus.Terminated;
  }
 else   if (groupCreated) {
    status=GroupStatus.Created;
  }
  return status;
}

Fixed version (ground truth):
private GroupStatus getGroupStatus(Map<String,Group> groups){
  GroupStatus status=null;
  boolean groupActive=true;
  boolean groupTerminated=true;
  boolean groupCreated=true;
  for (  Group group : groups.values()) {
    if (group.getStatus() == GroupStatus.Active) {
      groupActive=groupActive && true;
      groupTerminated=false;
      groupCreated=false;
    }
 else     if (group.getStatus() == GroupStatus.Inactive) {
      status=GroupStatus.Inactive;
      groupActive=false;
      groupTerminated=false;
      groupCreated=false;
      break;
    }
 else     if (group.getStatus() == GroupStatus.Terminated) {
      groupActive=false;
      groupCreated=false;
      groupTerminated=groupTerminated && true;
    }
 else     if (group.getStatus() == GroupStatus.Created) {
      groupActive=false;
      groupTerminated=false;
      groupCreated=groupCreated && true;
    }
 else     if (group.getStatus() == GroupStatus.Terminating) {
      groupActive=false;
      groupTerminated=false;
      groupCreated=false;
      status=GroupStatus.Terminating;
    }
  }
  if (groupActive) {
    status=GroupStatus.Active;
  }
 else   if (groupTerminated) {
    status=GroupStatus.Terminated;
  }
 else   if (groupCreated) {
    status=GroupStatus.Created;
  }
  return status;
}
Program: 116417
Project: 116417
Buggy source:
public void setStatus(ClusterStatus status){
  this.status=status;
  if (status == ClusterStatus.Inactive && !this.hasDependent) {
    log.info("String_Node_Str" + clusterId + "String_Node_Str"+ "String_Node_Str");
  }
 else   if (status == ClusterStatus.Terminating) {
    log.info("String_Node_Str" + clusterId + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,this.status,this.clusterId);
  }
}

Fixed version (ground truth):
public void setStatus(ClusterStatus status){
  this.status=status;
  if (status == ClusterStatus.Inactive && !this.hasDependent) {
    log.info("String_Node_Str" + clusterId + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    log.info("String_Node_Str" + this.id + "String_Node_Str"+ this.parent.getId());
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,this.status,this.clusterId);
  }
}
Program: 116419
Project: 116419
Buggy source:
@Override public void onChildEvent(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  LifeCycleState status1=statusEvent.getStatus();
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(id);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    onChildInActiveEvent(id);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    this.aliasToInActiveMonitorsMap.remove(id);
    if (this.status != ApplicationStatus.Terminating || this.status != ApplicationStatus.Terminated) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}

Fixed version (ground truth):
@Override public void onChildEvent(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  LifeCycleState status1=statusEvent.getStatus();
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(id);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    onChildInActiveEvent(id);
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminated) {
    this.markMonitorAsInactive(id);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.aliasToInActiveMonitorsMap.containsKey(id)) {
      this.aliasToInActiveMonitorsMap.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    if (this.status != ApplicationStatus.Terminating || this.status != ApplicationStatus.Terminated) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}
Program: 116420
Project: 116420
Buggy source:
@Override public void onParentEvent(MonitorStatusEvent statusEvent){
  if (statusEvent.getStatus() == GroupStatus.Terminating || statusEvent.getStatus() == ApplicationStatus.Terminating) {
    StatusEventPublisher.sendGroupTerminatingEvent(appId,id);
    this.markMonitorAsInactive(id);
  }
}

Fixed version (ground truth):
@Override public void onParentEvent(MonitorStatusEvent statusEvent){
  if (statusEvent.getStatus() == GroupStatus.Terminating || statusEvent.getStatus() == ApplicationStatus.Terminating) {
    StatusEventPublisher.sendGroupTerminatingEvent(appId,id);
  }
}
Program: 116421
Project: 116421
Buggy source:
@Override public void onChildEvent(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  LifeCycleState status1=statusEvent.getStatus();
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(id);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    onChildInActiveEvent(id);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    this.aliasToInActiveMonitorsMap.remove(id);
    if (this.status != GroupStatus.Terminating || this.status != GroupStatus.Terminated) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}

Fixed version (ground truth):
@Override public void onChildEvent(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  LifeCycleState status1=statusEvent.getStatus();
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(id);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    onChildInActiveEvent(id);
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminated) {
    this.markMonitorAsInactive(id);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.aliasToInActiveMonitorsMap.containsKey(id)) {
      this.aliasToInActiveMonitorsMap.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    if (this.status != GroupStatus.Terminating || this.status != GroupStatus.Terminated) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}
Program: 116422
Project: 116422
Buggy source:
/** 
 * Will set the status of the monitor based on Topology Group status/child status like scaling
 * @param status
 */
public void setStatus(GroupStatus status){
  this.status=status;
  if (status == GroupStatus.Inactive && !this.hasDependent) {
    log.info("String_Node_Str" + this.id + "String_Node_Str"+ "String_Node_Str");
  }
 else   if (status == GroupStatus.Terminating) {
    log.info("String_Node_Str" + this.id + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    MonitorStatusEventBuilder.handleGroupStatusEvent(this.parent,this.status,this.id);
  }
  MonitorStatusEventBuilder.notifyChildren(this,new GroupStatusEvent(status,getId()));
}

Fixed version (ground truth):
/** 
 * Will set the status of the monitor based on Topology Group status/child status like scaling
 * @param status
 */
public void setStatus(GroupStatus status){
  this.status=status;
  if (status == GroupStatus.Inactive && !this.hasDependent) {
    log.info("String_Node_Str" + this.id + "String_Node_Str"+ "String_Node_Str");
  }
 else {
    log.info("String_Node_Str" + this.id + "String_Node_Str"+ this.parent.getId());
    MonitorStatusEventBuilder.handleGroupStatusEvent(this.parent,this.status,this.id);
  }
  MonitorStatusEventBuilder.notifyChildren(this,new GroupStatusEvent(status,getId()));
}
Program: 116423
Project: 116423
Buggy source:
private ClusterStatus getClusterStatus(Map<String,ClusterDataHolder> clusterData){
  ClusterStatus status=null;
  boolean clusterActive=false;
  boolean clusterTerminated=false;
  for (  Map.Entry<String,ClusterDataHolder> clusterDataHolderEntry : clusterData.entrySet()) {
    Service service=TopologyManager.getTopology().getService(clusterDataHolderEntry.getValue().getServiceType());
    Cluster cluster=service.getCluster(clusterDataHolderEntry.getValue().getClusterId());
    if (cluster.getStatus() == ClusterStatus.Active) {
      clusterActive=true;
      clusterTerminated=false;
    }
 else     if (cluster.getStatus() == ClusterStatus.Inactive) {
      status=ClusterStatus.Inactive;
      clusterActive=false;
      clusterTerminated=false;
      break;
    }
 else     if (cluster.getStatus() == ClusterStatus.Terminated) {
      clusterActive=false;
      clusterTerminated=true;
    }
 else     if (cluster.getStatus() == ClusterStatus.Terminating) {
      status=ClusterStatus.Terminating;
      clusterActive=false;
      clusterTerminated=false;
    }
 else     if (cluster.getStatus() == ClusterStatus.Created) {
      status=ClusterStatus.Created;
      clusterActive=false;
      clusterTerminated=false;
    }
  }
  if (clusterActive) {
    status=ClusterStatus.Active;
  }
 else   if (clusterTerminated) {
    status=ClusterStatus.Terminated;
  }
  return status;
}

Fixed version (ground truth):
private ClusterStatus getClusterStatus(Map<String,ClusterDataHolder> clusterData){
  ClusterStatus status=null;
  boolean clusterActive=true;
  boolean clusterTerminated=true;
  for (  Map.Entry<String,ClusterDataHolder> clusterDataHolderEntry : clusterData.entrySet()) {
    Service service=TopologyManager.getTopology().getService(clusterDataHolderEntry.getValue().getServiceType());
    Cluster cluster=service.getCluster(clusterDataHolderEntry.getValue().getClusterId());
    if (cluster.getStatus() == ClusterStatus.Active) {
      clusterActive=clusterActive && true;
      clusterTerminated=false;
    }
 else     if (cluster.getStatus() == ClusterStatus.Inactive) {
      status=ClusterStatus.Inactive;
      clusterActive=false;
      clusterTerminated=false;
      break;
    }
 else     if (cluster.getStatus() == ClusterStatus.Terminated) {
      clusterActive=false;
      clusterTerminated=clusterTerminated && true;
    }
 else     if (cluster.getStatus() == ClusterStatus.Terminating) {
      status=ClusterStatus.Terminating;
      clusterActive=false;
      clusterTerminated=false;
    }
 else     if (cluster.getStatus() == ClusterStatus.Created) {
      status=ClusterStatus.Created;
      clusterActive=false;
      clusterTerminated=false;
    }
  }
  if (clusterActive) {
    status=ClusterStatus.Active;
  }
 else   if (clusterTerminated) {
    status=ClusterStatus.Terminated;
  }
  return status;
}
Program: 116424
Project: 116424
Buggy source:
/** 
 * Calculating whether the cluster has all min instances as active and send the ClusterActivatedEvent.
 * @param clusterId id of the cluster
 */
public void onMemberStatusChange(final String clusterId){
  Runnable group=new Runnable(){
    public void run(){
      ClusterMonitor monitor=(ClusterMonitor)AutoscalerContext.getInstance().getMonitor(clusterId);
      boolean clusterActive=false;
      if (monitor != null) {
        clusterActive=clusterActive(monitor);
      }
      log.info("String_Node_Str" + clusterId + "String_Node_Str"+ clusterActive);
      if (clusterActive) {
        StatusEventPublisher.sendClusterActivatedEvent(monitor.getAppId(),monitor.getServiceId(),monitor.getClusterId());
      }
    }
  }
;
  Thread groupThread=new Thread(group);
  groupThread.start();
}

Fixed version (ground truth):
/** 
 * Calculating whether the cluster has all min instances as active and send the ClusterActivatedEvent.
 * @param clusterId id of the cluster
 */
public void onMemberStatusChange(final String clusterId){
  Runnable group=new Runnable(){
    public void run(){
      ClusterMonitor monitor=(ClusterMonitor)AutoscalerContext.getInstance().getMonitor(clusterId);
      boolean clusterActive=false;
      if (monitor != null) {
        clusterActive=clusterActive(monitor);
      }
      log.info("String_Node_Str" + clusterId + "String_Node_Str"+ clusterActive);
      if (clusterActive) {
        monitor.setHasFaultyMember(false);
        StatusEventPublisher.sendClusterActivatedEvent(monitor.getAppId(),monitor.getServiceId(),monitor.getClusterId());
      }
    }
  }
;
  Thread groupThread=new Thread(group);
  groupThread.start();
}
Program: 116425
Project: 116425
Buggy source:
private GroupStatus getGroupStatus(Map<String,Group> groups){
  GroupStatus status=null;
  boolean groupActive=false;
  boolean groupTerminated=false;
  for (  Group group : groups.values()) {
    if (group.getStatus() == GroupStatus.Active) {
      groupActive=true;
      groupTerminated=false;
    }
 else     if (group.getStatus() == GroupStatus.Inactive) {
      status=GroupStatus.Inactive;
      break;
    }
 else     if (group.getStatus() == GroupStatus.Terminated) {
      groupActive=false;
      groupTerminated=true;
    }
 else     if (group.getStatus() == GroupStatus.Created) {
      groupActive=false;
      groupTerminated=false;
      status=GroupStatus.Created;
    }
 else     if (group.getStatus() == GroupStatus.Terminating) {
      groupActive=false;
      groupTerminated=false;
      status=GroupStatus.Terminating;
    }
  }
  if (groupActive) {
    status=GroupStatus.Active;
  }
 else   if (groupTerminated) {
    status=GroupStatus.Terminated;
  }
  return status;
}

Fixed version (ground truth):
private GroupStatus getGroupStatus(Map<String,Group> groups){
  GroupStatus status=null;
  boolean groupActive=true;
  boolean groupTerminated=true;
  for (  Group group : groups.values()) {
    if (group.getStatus() == GroupStatus.Active) {
      groupActive=groupActive && true;
      groupTerminated=false;
    }
 else     if (group.getStatus() == GroupStatus.Inactive) {
      status=GroupStatus.Inactive;
      break;
    }
 else     if (group.getStatus() == GroupStatus.Terminated) {
      groupActive=false;
      groupTerminated=groupTerminated && true;
    }
 else     if (group.getStatus() == GroupStatus.Created) {
      groupActive=false;
      groupTerminated=false;
      status=GroupStatus.Created;
    }
 else     if (group.getStatus() == GroupStatus.Terminating) {
      groupActive=false;
      groupTerminated=false;
      status=GroupStatus.Terminating;
    }
  }
  if (groupActive) {
    status=GroupStatus.Active;
  }
 else   if (groupTerminated) {
    status=GroupStatus.Terminated;
  }
  return status;
}
Program: 116427
Project: 116427
Buggy source:
/** 
 * Validates terminationBehavior. The terminationBehavior should be one of the following: 1. terminate-none 2. terminate-dependents 3. terminate-all
 * @throws ApplicationDefinitionException if terminationBehavior is different to what islisted above
 */
private static void validateTerminationBehavior(String terminationBehavior) throws ApplicationDefinitionException {
  if (terminationBehavior != null && terminationBehavior != "String_Node_Str" && terminationBehavior != "String_Node_Str" && terminationBehavior != "String_Node_Str") {
    throw new ApplicationDefinitionException("String_Node_Str" + terminationBehavior + "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Validates terminationBehavior. The terminationBehavior should be one of the following: 1. terminate-none 2. terminate-dependents 3. terminate-all
 * @throws ApplicationDefinitionException if terminationBehavior is different to what islisted above
 */
private static void validateTerminationBehavior(String terminationBehavior) throws ApplicationDefinitionException {
  if (!(terminationBehavior == null || "String_Node_Str".equals(terminationBehavior) || "String_Node_Str".equals(terminationBehavior) || "String_Node_Str".equals(terminationBehavior))) {
    throw new ApplicationDefinitionException("String_Node_Str" + terminationBehavior + "String_Node_Str"+ "String_Node_Str");
  }
}
Program: 116428
Project: 116428
Buggy source:
/** 
 * Validates terminationBehavior. The terminationBehavior should be one of the following: 1. terminate-none 2. terminate-dependents 3. terminate-all
 * @throws ServiceGroupDefinitioException if terminationBehavior is different to what islisted above
 */
private static void validateTerminationBehavior(String terminationBehavior) throws ServiceGroupDefinitioException {
  if (terminationBehavior != null && terminationBehavior != "String_Node_Str" && terminationBehavior != "String_Node_Str" && terminationBehavior != "String_Node_Str") {
    throw new ServiceGroupDefinitioException("String_Node_Str" + terminationBehavior + "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Validates terminationBehavior. The terminationBehavior should be one of the following: 1. terminate-none 2. terminate-dependents 3. terminate-all
 * @throws ServiceGroupDefinitioException if terminationBehavior is different to what islisted above
 */
private static void validateTerminationBehavior(String terminationBehavior) throws ServiceGroupDefinitioException {
  if (!(terminationBehavior == null || "String_Node_Str".equals(terminationBehavior) || "String_Node_Str".equals(terminationBehavior) || "String_Node_Str".equals(terminationBehavior))) {
    throw new ServiceGroupDefinitioException("String_Node_Str" + terminationBehavior + "String_Node_Str"+ "String_Node_Str");
  }
}
Program: 116429
Project: 116429
Buggy source:
public static void sendGroupTerminatingEvent(String appId,String groupId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId + "String_Node_Str"+ groupId);
  }
  AppStatusGroupTerminatingEvent groupInTerminatingEvent=new AppStatusGroupTerminatingEvent(appId,groupId);
  publishEvent(groupInTerminatingEvent);
}

Fixed version (ground truth):
public static void sendGroupTerminatingEvent(String appId,String groupId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId + "String_Node_Str"+ groupId);
  }
  try {
    TopologyManager.acquireReadLockForApplication(appId);
    Application application=TopologyManager.getTopology().getApplication(appId);
    if (application != null) {
      Group group=application.getGroupRecursively(groupId);
      if (group.getStatus().getNextStates().contains(GroupStatus.Terminating)) {
        AppStatusGroupTerminatingEvent groupInTerminatingEvent=new AppStatusGroupTerminatingEvent(appId,groupId);
        publishEvent(groupInTerminatingEvent);
      }
 else {
        log.warn("String_Node_Str" + groupId);
      }
    }
  }
  finally {
    TopologyManager.releaseReadLockForApplication(appId);
  }
}
Program: 116430
Project: 116430
Buggy source:
public static void sendGroupActivatedEvent(String appId,String groupId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId + "String_Node_Str"+ groupId);
  }
  AppStatusGroupActivatedEvent groupActivatedEvent=new AppStatusGroupActivatedEvent(appId,groupId);
  publishEvent(groupActivatedEvent);
}

Fixed version (ground truth):
public static void sendGroupActivatedEvent(String appId,String groupId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId + "String_Node_Str"+ groupId);
  }
  try {
    TopologyManager.acquireReadLockForApplication(appId);
    Application application=TopologyManager.getTopology().getApplication(appId);
    if (application != null) {
      Group group=application.getGroupRecursively(groupId);
      if (group.getStatus().getNextStates().contains(GroupStatus.Active)) {
        AppStatusGroupActivatedEvent groupActivatedEvent=new AppStatusGroupActivatedEvent(appId,groupId);
        publishEvent(groupActivatedEvent);
      }
 else {
        log.warn("String_Node_Str" + groupId);
      }
    }
  }
  finally {
    TopologyManager.releaseReadLockForApplication(appId);
  }
}
Program: 116431
Project: 116431
Buggy source:
public static void sendGroupTerminatedEvent(String appId,String groupId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId + "String_Node_Str"+ groupId);
  }
  AppStatusGroupTerminatedEvent groupInTerminatedEvent=new AppStatusGroupTerminatedEvent(appId,groupId);
  publishEvent(groupInTerminatedEvent);
}

Fixed version (ground truth):
public static void sendGroupTerminatedEvent(String appId,String groupId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId + "String_Node_Str"+ groupId);
  }
  try {
    TopologyManager.acquireReadLockForApplication(appId);
    Application application=TopologyManager.getTopology().getApplication(appId);
    if (application != null) {
      Group group=application.getGroupRecursively(groupId);
      if (group.getStatus().getNextStates().contains(GroupStatus.Terminated)) {
        AppStatusGroupTerminatedEvent groupInTerminatedEvent=new AppStatusGroupTerminatedEvent(appId,groupId);
        publishEvent(groupInTerminatedEvent);
      }
 else {
        log.warn("String_Node_Str" + groupId);
      }
    }
  }
  finally {
    TopologyManager.releaseReadLockForApplication(appId);
  }
}