nus-yam/ex-repair huggingface dataset:
Program: 116324
Project: 116324
Buggy source:
private boolean waitForStatus(String volumeId,Volume.State expectedStatus,int timeoutInMins) throws TimeoutException {
  int timeout=1000 * 60 * timeoutInMins;
  long timout=System.currentTimeMillis() + timeout;
  IaasProvider iaasInfo=getIaasProvider();
  ComputeServiceContext context=iaasInfo.getComputeService().getContext();
  CloudStackApi cloudStackApi=context.unwrapApi(CloudStackApi.class);
  org.jclouds.cloudstack.domain.Volume volume=cloudStackApi.getVolumeApi().getVolume(volumeId);
  Volume.State volumeState=volume.getState();
  while (volumeState != expectedStatus) {
    try {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",volumeId,expectedStatus,volumeState));
      }
      if (volumeState == Volume.State.FAILED || volumeState == Volume.State.DESTROYED || volumeState == Volume.State.UNRECOGNIZED) {
        log.error("String_Node_Str" + volumeId + "String_Node_Str"+ volumeState);
        return false;
      }
      Thread.sleep(1000);
      volumeState=volume.getState();
      if (System.currentTimeMillis() > timout) {
        throw new TimeoutException();
      }
    }
 catch (    InterruptedException e) {
    }
  }
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",volumeId,expectedStatus));
  }
  return true;
}

Fixed version (ground truth):
private boolean waitForStatus(String volumeId,Volume.State expectedStatus,int timeoutInMilliseconds) throws TimeoutException {
  int timeout=1000 * 60 * timeoutInMilliseconds;
  long timout=System.currentTimeMillis() + timeout;
  IaasProvider iaasInfo=getIaasProvider();
  ComputeServiceContext context=iaasInfo.getComputeService().getContext();
  CloudStackApi cloudStackApi=context.unwrapApi(CloudStackApi.class);
  org.jclouds.cloudstack.domain.Volume volume=cloudStackApi.getVolumeApi().getVolume(volumeId);
  Volume.State volumeState=volume.getState();
  while (volumeState != expectedStatus) {
    try {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",volumeId,expectedStatus,volumeState));
      }
      if (volumeState == Volume.State.FAILED || volumeState == Volume.State.DESTROYED || volumeState == Volume.State.UNRECOGNIZED) {
        log.error("String_Node_Str" + volumeId + "String_Node_Str"+ volumeState);
        return false;
      }
      Thread.sleep(1000);
      volumeState=volume.getState();
      if (System.currentTimeMillis() > timout) {
        throw new TimeoutException();
      }
    }
 catch (    InterruptedException e) {
    }
  }
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",volumeId,expectedStatus));
  }
  return true;
}
Program: 116326
Project: 116326
Buggy source:
/** 
 * When one group/cluster terminates/in_maintenance, need to consider about other dependencies
 * @param id the alias/id of group/cluster in which terminated event received
 * @return all the kill able children dependencies
 */
public List<ApplicationContext> getTerminationDependencies(String id){
  List<ApplicationContext> allChildrenOfAppContext=new ArrayList<ApplicationContext>();
  ApplicationContext applicationContext=findApplicationContextWithId(id);
  if (terminationBehavior == TerminationBehavior.TERMINATE_DEPENDENT) {
    allChildrenOfAppContext.add(applicationContext);
    findAllChildrenOfAppContext(applicationContext.getApplicationContextList(),allChildrenOfAppContext);
    return allChildrenOfAppContext;
  }
 else   if (terminationBehavior == TerminationBehavior.TERMINATE_DEPENDENT) {
    findAllChildrenOfAppContext(this.applicationContextList,allChildrenOfAppContext);
  }
  return allChildrenOfAppContext;
}

Fixed version (ground truth):
/** 
 * When one group/cluster terminates/in_maintenance, need to consider about other dependencies
 * @param id the alias/id of group/cluster in which terminated event received
 * @return all the kill able children dependencies
 */
public List<ApplicationContext> getTerminationDependencies(String id){
  List<ApplicationContext> allChildrenOfAppContext=new ArrayList<ApplicationContext>();
  ApplicationContext applicationContext=findApplicationContextWithId(id);
  allChildrenOfAppContext.add(applicationContext);
  if (terminationBehavior == TerminationBehavior.TERMINATE_DEPENDENT) {
    findAllChildrenOfAppContext(applicationContext.getApplicationContextList(),allChildrenOfAppContext);
    return allChildrenOfAppContext;
  }
 else   if (terminationBehavior == TerminationBehavior.TERMINATE_ALL) {
    findAllChildrenOfAppContext(this.applicationContextList,allChildrenOfAppContext);
  }
  return allChildrenOfAppContext;
}
Program: 116327
Project: 116327
Buggy source:
protected void onChildTerminatedEvent(String eventId){
  List<ApplicationContext> terminationList;
  boolean allDependentTerminated=false;
  ApplicationContext context=this.startupDependencyTree.findApplicationContextWithId(eventId);
  context.setTerminated(true);
  terminationList=this.startupDependencyTree.getTerminationDependencies(eventId);
  if (terminationList != null) {
    allDependentTerminated=allDependentTerminated(terminationList);
  }
  List<ApplicationContext> parentContexts=this.startupDependencyTree.findAllParentContextWithId(eventId);
  boolean parentsTerminated=false;
  if (parentContexts != null) {
    parentsTerminated=allParentTerminated(parentContexts);
  }
  if ((terminationList != null && allDependentTerminated || terminationList.isEmpty()) && (parentContexts != null && parentsTerminated || parentContexts.isEmpty())) {
    try {
      this.startDependencyOnTermination();
      List<ApplicationContext> applicationContexts=this.startupDependencyTree.getStarAbleDependenciesByTermination();
    }
 catch (    TopologyInConsistentException e) {
      log.error("String_Node_Str" + e);
    }
  }
 else {
    StatusChecker.getInstance().onChildStatusChange(eventId,this.id,this.appId);
    log.info("String_Node_Str" + "String_Node_Str");
  }
}

Fixed version (ground truth):
protected void onChildTerminatedEvent(String eventId){
  List<ApplicationContext> terminationList;
  boolean allDependentTerminated=false;
  ApplicationContext context=this.startupDependencyTree.findApplicationContextWithId(eventId);
  context.setTerminated(true);
  terminationList=this.startupDependencyTree.getTerminationDependencies(eventId);
  if (terminationList != null) {
    allDependentTerminated=allDependentTerminated(terminationList);
  }
  List<ApplicationContext> parentContexts=this.startupDependencyTree.findAllParentContextWithId(eventId);
  boolean parentsTerminated=false;
  if (parentContexts != null) {
    parentsTerminated=allParentTerminated(parentContexts);
  }
  if ((terminationList != null && allDependentTerminated || terminationList.isEmpty()) && (parentContexts != null && parentsTerminated || parentContexts.isEmpty())) {
    try {
      this.startDependencyOnTermination();
    }
 catch (    TopologyInConsistentException e) {
      log.error("String_Node_Str" + e);
    }
  }
 else {
    StatusChecker.getInstance().onChildStatusChange(eventId,this.id,this.appId);
    log.info("String_Node_Str" + "String_Node_Str");
  }
}
Program: 116328
Project: 116328
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.Terminating || status1 == GroupStatus.Terminating) {
    this.markMonitorAsInactive(id);
  }
 else   if (status1 == ClusterStatus.Created || status1 == GroupStatus.Created) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
    if (this.status == ApplicationStatus.Terminating) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
    }
 else {
      onChildTerminatedEvent(id);
    }
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    if (this.status == ApplicationStatus.Terminating || this.status == ApplicationStatus.Terminated) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
 else {
      onChildTerminatedEvent(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.Terminating) {
    this.markMonitorAsInactive(id);
  }
 else   if (status1 == ClusterStatus.Created || status1 == GroupStatus.Created) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
      this.aliasToActiveMonitorsMap.remove(id);
    }
    if (this.status == ApplicationStatus.Terminating) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
    }
 else {
      onChildTerminatedEvent(id);
    }
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    if (this.status == ApplicationStatus.Terminating || this.status == ApplicationStatus.Terminated) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
 else {
      onChildTerminatedEvent(id);
    }
  }
}
Program: 116329
Project: 116329
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.Created || status1 == GroupStatus.Created) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
    if (this.status == GroupStatus.Terminating) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
    }
 else {
      onChildTerminatedEvent(id);
    }
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    this.markMonitorAsInactive(id);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    if (this.status == GroupStatus.Terminating || this.status == GroupStatus.Terminated) {
      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.Created || status1 == GroupStatus.Created) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
      this.aliasToActiveMonitorsMap.remove(id);
    }
    if (this.status == GroupStatus.Terminating) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
    }
 else {
      onChildTerminatedEvent(id);
    }
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    this.markMonitorAsInactive(id);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    if (this.status == GroupStatus.Terminating || this.status == GroupStatus.Terminated) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}
Program: 116331
Project: 116331
Buggy source:
public void setAliasToInActiveMonitorsMap(Map<String,Monitor> aliasToInActiveMonitorsMap){
  this.aliasToInactiveMonitorsMap=aliasToInActiveMonitorsMap;
}

Fixed version (ground truth):
public void setAliasToInActiveMonitorsMap(List<String> inactiveMonitorsList){
  this.inactiveMonitorsList=inactiveMonitorsList;
}
Program: 116332
Project: 116332
Buggy source:
public boolean hasActiveMonitors(){
  boolean hasMonitor=false;
  if ((this.aliasToActiveMonitorsMap != null && !this.aliasToActiveMonitorsMap.isEmpty()) || (this.aliasToInactiveMonitorsMap != null && !this.aliasToInactiveMonitorsMap.isEmpty())) {
    hasMonitor=true;
  }
  return hasMonitor;
}

Fixed version (ground truth):
public boolean hasActiveMonitors(){
  boolean hasMonitor=false;
  if ((this.aliasToActiveMonitorsMap != null && !this.aliasToActiveMonitorsMap.isEmpty()) || (this.inactiveMonitorsList != null && !this.inactiveMonitorsList.isEmpty())) {
    hasMonitor=true;
  }
  return hasMonitor;
}
Program: 116333
Project: 116333
Buggy source:
public boolean hasMonitors(){
  return this.aliasToActiveMonitorsMap != null || this.aliasToInactiveMonitorsMap != null;
}

Fixed version (ground truth):
public boolean hasMonitors(){
  return this.aliasToActiveMonitorsMap != null || this.inactiveMonitorsList != null;
}
Program: 116334
Project: 116334
Buggy source:
public Map<String,Monitor> getAliasToInActiveMonitorsMap(){
  return this.aliasToInactiveMonitorsMap;
}

Fixed version (ground truth):
public List<String> getAliasToInActiveMonitorsMap(){
  return this.inactiveMonitorsList;
}
Program: 116335
Project: 116335
Buggy source:
public ParentComponentMonitor(ParentComponent component) throws DependencyBuilderException {
  aliasToActiveMonitorsMap=new HashMap<String,Monitor>();
  aliasToInactiveMonitorsMap=new HashMap<String,Monitor>();
  this.id=component.getUniqueIdentifier();
  startupDependencyTree=DependencyBuilder.getInstance().buildStartupDependency(component);
  scalingDependencyTree=DependencyBuilder.getInstance().buildStartupDependency(component);
}

Fixed version (ground truth):
public ParentComponentMonitor(ParentComponent component) throws DependencyBuilderException {
  aliasToActiveMonitorsMap=new HashMap<String,Monitor>();
  inactiveMonitorsList=new ArrayList<String>();
  this.id=component.getUniqueIdentifier();
  startupDependencyTree=DependencyBuilder.getInstance().buildStartupDependency(component);
  scalingDependencyTree=DependencyBuilder.getInstance().buildStartupDependency(component);
}
Program: 116336
Project: 116336
Buggy source:
/** 
 * @param eventId
 */
protected void onChildInactiveEvent(String eventId){
  List<ApplicationContext> terminationList;
  Monitor monitor;
  if (this.hasDependent) {
    StatusChecker.getInstance().onChildStatusChange(eventId,this.id,this.appId);
  }
 else {
    terminationList=this.startupDependencyTree.getTerminationDependencies(eventId);
    if (terminationList.size() == (this.aliasToActiveMonitorsMap.size() + this.aliasToInactiveMonitorsMap.size())) {
      if (this.parent != null) {
        ApplicationBuilder.handleGroupTerminatingEvent(this.appId,this.id);
      }
    }
 else {
      if (this.parent != null) {
        ApplicationBuilder.handleGroupInActivateEvent(this.appId,this.id);
      }
      if (terminationList != null) {
        for (        ApplicationContext terminationContext : terminationList) {
          monitor=this.aliasToActiveMonitorsMap.get(terminationContext.getId());
          if (monitor != null) {
            if (monitor.hasActiveMonitors()) {
              ApplicationBuilder.handleGroupTerminatingEvent(this.appId,terminationContext.getId());
            }
 else {
              ClusterStatusEventPublisher.sendClusterTerminatingEvent(this.appId,((AbstractClusterMonitor)monitor).getServiceId(),terminationContext.getId());
            }
          }
 else {
            log.warn("String_Node_Str" + terminationContext.getId() + "String_Node_Str");
          }
        }
      }
 else {
        log.warn("String_Node_Str" + eventId + "String_Node_Str"+ "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param eventId
 */
protected void onChildInactiveEvent(String eventId){
  List<ApplicationContext> terminationList;
  Monitor monitor;
  if (this.hasDependent) {
    StatusChecker.getInstance().onChildStatusChange(eventId,this.id,this.appId);
  }
 else {
    terminationList=this.startupDependencyTree.getTerminationDependencies(eventId);
    if (terminationList.size() == (this.aliasToActiveMonitorsMap.size())) {
      if (this.parent != null) {
        ApplicationBuilder.handleGroupTerminatingEvent(this.appId,this.id);
      }
    }
 else {
      if (this.parent != null) {
        ApplicationBuilder.handleGroupInActivateEvent(this.appId,this.id);
      }
      if (terminationList != null) {
        for (        ApplicationContext terminationContext : terminationList) {
          monitor=this.aliasToActiveMonitorsMap.get(terminationContext.getId());
          if (monitor != null) {
            if (monitor.hasActiveMonitors()) {
              ApplicationBuilder.handleGroupTerminatingEvent(this.appId,terminationContext.getId());
            }
 else {
              ClusterStatusEventPublisher.sendClusterTerminatingEvent(this.appId,((AbstractClusterMonitor)monitor).getServiceId(),terminationContext.getId());
            }
          }
 else {
            log.warn("String_Node_Str" + terminationContext.getId() + "String_Node_Str");
          }
        }
      }
 else {
        log.warn("String_Node_Str" + eventId + "String_Node_Str"+ "String_Node_Str");
      }
    }
  }
}
Program: 116337
Project: 116337
Buggy source:
private boolean allDependentTerminated(List<ApplicationContext> terminationList){
  boolean allDependentTerminated=false;
  for (  ApplicationContext context1 : terminationList) {
    if (this.aliasToActiveMonitorsMap.containsKey(context1.getId())) {
      log.warn("String_Node_Str" + context1.getId() + "String_Node_Str");
      allDependentTerminated=false;
      return allDependentTerminated;
    }
 else     if (this.aliasToInactiveMonitorsMap.containsKey(context1.getId())) {
      log.info("String_Node_Str" + context1.getId() + "String_Node_Str");
      allDependentTerminated=false;
      return allDependentTerminated;
    }
 else {
      allDependentTerminated=true;
    }
  }
  return allDependentTerminated;
}

Fixed version (ground truth):
private boolean allDependentTerminated(List<ApplicationContext> terminationList){
  boolean allDependentTerminated=false;
  for (  ApplicationContext context1 : terminationList) {
    if (this.aliasToActiveMonitorsMap.containsKey(context1.getId())) {
      log.warn("String_Node_Str" + context1.getId() + "String_Node_Str");
      allDependentTerminated=false;
      return allDependentTerminated;
    }
 else     if (this.inactiveMonitorsList.contains(context1.getId())) {
      log.info("String_Node_Str" + context1.getId() + "String_Node_Str");
      allDependentTerminated=false;
      return allDependentTerminated;
    }
 else {
      allDependentTerminated=true;
    }
  }
  return allDependentTerminated;
}
Program: 116338
Project: 116338
Buggy source:
private boolean allParentTerminated(List<ApplicationContext> parentContexts){
  boolean parentsTerminated=false;
  for (  ApplicationContext context1 : parentContexts) {
    if (this.aliasToInactiveMonitorsMap.containsKey(context1.getId())) {
      log.info("String_Node_Str" + context1.getId() + "String_Node_Str");
      parentsTerminated=false;
      return parentsTerminated;
    }
 else     if (this.aliasToActiveMonitorsMap.containsKey(context1.getId())) {
      if (parentsTerminated) {
        log.warn("String_Node_Str" + context1.getId() + "String_Node_Str");
      }
    }
 else {
      log.info("String_Node_Str" + context1.getId() + "String_Node_Str");
      parentsTerminated=true;
    }
  }
  return parentsTerminated;
}

Fixed version (ground truth):
private boolean allParentTerminated(List<ApplicationContext> parentContexts){
  boolean parentsTerminated=false;
  for (  ApplicationContext context1 : parentContexts) {
    if (this.inactiveMonitorsList.contains(context1.getId())) {
      log.info("String_Node_Str" + context1.getId() + "String_Node_Str");
      parentsTerminated=false;
      return parentsTerminated;
    }
 else     if (this.aliasToActiveMonitorsMap.containsKey(context1.getId())) {
      if (parentsTerminated) {
        log.warn("String_Node_Str" + context1.getId() + "String_Node_Str");
      }
    }
 else {
      log.info("String_Node_Str" + context1.getId() + "String_Node_Str");
      parentsTerminated=true;
    }
  }
  return parentsTerminated;
}
Program: 116339
Project: 116339
Buggy source:
/** 
 * This will start the child monitors based on the active of siblings according to start up order
 * @param eventId parent id of the event which received
 */
protected void onChildActivatedEvent(String eventId){
  try {
    if (this.aliasToInactiveMonitorsMap.containsKey(eventId)) {
      this.aliasToActiveMonitorsMap.put(id,this.aliasToInactiveMonitorsMap.remove(eventId));
    }
    boolean startDep=startDependency(eventId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + startDep + "String_Node_Str"+ eventId);
    }
    if (!startDep) {
      StatusChecker.getInstance().onChildStatusChange(eventId,this.id,this.appId);
    }
  }
 catch (  TopologyInConsistentException e) {
    log.error(e);
  }
}

Fixed version (ground truth):
/** 
 * This will start the child monitors based on the active of siblings according to start up order
 * @param eventId parent id of the event which received
 */
protected void onChildActivatedEvent(String eventId){
  try {
    if (this.inactiveMonitorsList.contains(eventId)) {
      this.aliasToActiveMonitorsMap.put(id,this.aliasToActiveMonitorsMap.remove(eventId));
    }
    boolean startDep=startDependency(eventId);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + startDep + "String_Node_Str"+ eventId);
    }
    if (!startDep) {
      StatusChecker.getInstance().onChildStatusChange(eventId,this.id,this.appId);
    }
  }
 catch (  TopologyInConsistentException e) {
    log.error(e);
  }
}
Program: 116340
Project: 116340
Buggy source:
protected synchronized void markMonitorAsInactive(String monitorKey){
  if (!this.aliasToInactiveMonitorsMap.containsKey(monitorKey)) {
    this.aliasToInactiveMonitorsMap.put(monitorKey,this.aliasToActiveMonitorsMap.remove(monitorKey));
  }
}

Fixed version (ground truth):
protected synchronized void markMonitorAsInactive(String monitorKey){
  if (!this.inactiveMonitorsList.contains(monitorKey)) {
    this.inactiveMonitorsList.add(monitorKey);
  }
}
Program: 116341
Project: 116341
Buggy source:
/** 
 * Utility method to find the group monitor recursively within app monitor
 * @param id       the unique alias of the Group
 * @param monitors the group monitors found in the app monitor
 * @return the found GroupMonitor
 */
private Monitor findGroupMonitor(String id,Collection<Monitor> monitors,boolean active){
  for (  Monitor monitor : monitors) {
    if (monitor.getId().equals(id)) {
      return monitor;
    }
 else {
      if (monitor.getAliasToActiveMonitorsMap() != null && active) {
        return findGroupMonitor(id,monitor.getAliasToActiveMonitorsMap().values(),active);
      }
 else       if (monitor.getAliasToInActiveMonitorsMap() != null && !active) {
        return findGroupMonitor(id,monitor.getAliasToInActiveMonitorsMap().values(),active);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Utility method to find the group monitor recursively within app monitor
 * @param id       the unique alias of the Group
 * @param monitors the group monitors found in the app monitor
 * @return the found GroupMonitor
 */
private Monitor findGroupMonitor(String id,Collection<Monitor> monitors){
  for (  Monitor monitor : monitors) {
    if (monitor.getId().equals(id)) {
      return monitor;
    }
 else {
      if (monitor.getAliasToActiveMonitorsMap() != null) {
        return findGroupMonitor(id,monitor.getAliasToActiveMonitorsMap().values());
      }
    }
  }
  return null;
}
Program: 116342
Project: 116342
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.Terminating || status1 == GroupStatus.Terminating) {
    this.markMonitorAsInactive(id);
  }
 else   if (status1 == ClusterStatus.Created || status1 == GroupStatus.Created) {
    if (this.aliasToInactiveMonitorsMap.containsKey(id)) {
      this.aliasToInactiveMonitorsMap.remove(id);
    }
    if (this.status == ApplicationStatus.Terminating) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
    }
 else {
      onChildTerminatedEvent(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) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
 else {
      onChildTerminatedEvent(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.Terminating) {
    this.markMonitorAsInactive(id);
  }
 else   if (status1 == ClusterStatus.Created || status1 == GroupStatus.Created) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
    if (this.status == ApplicationStatus.Terminating) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
    }
 else {
      onChildTerminatedEvent(id);
    }
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    if (this.status == ApplicationStatus.Terminating || this.status == ApplicationStatus.Terminated) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
 else {
      onChildTerminatedEvent(id);
    }
  }
}
Program: 116343
Project: 116343
Buggy source:
/** 
 * Find the group monitor by traversing recursively in the hierarchical monitors.
 * @param groupId the unique alias of the Group
 * @return the found GroupMonitor
 */
public Monitor findGroupMonitorWithId(String groupId){
  Monitor monitor;
  monitor=findGroupMonitor(groupId,aliasToActiveMonitorsMap.values(),true);
  if (monitor == null) {
    monitor=findGroupMonitor(groupId,aliasToInactiveMonitorsMap.values(),false);
  }
  return monitor;
}

Fixed version (ground truth):
/** 
 * Find the group monitor by traversing recursively in the hierarchical monitors.
 * @param groupId the unique alias of the Group
 * @return the found GroupMonitor
 */
public Monitor findGroupMonitorWithId(String groupId){
  Monitor monitor;
  return findGroupMonitor(groupId,aliasToActiveMonitorsMap.values());
}
Program: 116344
Project: 116344
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.Created || status1 == GroupStatus.Created) {
    if (this.aliasToInactiveMonitorsMap.containsKey(id)) {
      this.aliasToInactiveMonitorsMap.remove(id);
    }
    if (this.status == GroupStatus.Terminating) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
    }
 else {
      onChildTerminatedEvent(id);
    }
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    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) {
      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.Created || status1 == GroupStatus.Created) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
    if (this.status == GroupStatus.Terminating) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
    }
 else {
      onChildTerminatedEvent(id);
    }
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    this.markMonitorAsInactive(id);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.inactiveMonitorsList.contains(id)) {
      this.inactiveMonitorsList.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    if (this.status == GroupStatus.Terminating || this.status == GroupStatus.Terminated) {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}
Program: 116345
Project: 116345
Buggy source:
public AbstractClusterContext(String clusterId,String serviceId){
  this.clusterId=clusterId;
}

Fixed version (ground truth):
public AbstractClusterContext(String clusterId,String serviceId){
  this.clusterId=clusterId;
  this.serviceId=serviceId;
}
Program: 116346
Project: 116346
Buggy source:
@Override public void run(){
  while (!isDestroyed()) {
    try {
      if ((getStatus().getCode() <= ClusterStatus.Active.getCode()) || (getStatus() == ClusterStatus.Inactive && !hasDependent) || !this.hasFaultyMember) {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + this.toString());
        }
        monitor();
      }
 else {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + ClusterStatus.Inactive + "String_Node_Str");
        }
      }
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + this.toString(),e);
    }
    try {
      Thread.sleep(getMonitorIntervalMilliseconds());
    }
 catch (    InterruptedException ignore) {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (!isDestroyed()) {
    try {
      if (((getStatus().getCode() <= ClusterStatus.Active.getCode()) || (getStatus() == ClusterStatus.Inactive && !hasDependent)) && !this.hasFaultyMember && !stop) {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + this.toString());
        }
        monitor();
      }
 else {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + ClusterStatus.Inactive + "String_Node_Str");
        }
      }
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + this.toString(),e);
    }
    try {
      Thread.sleep(getMonitorIntervalMilliseconds());
    }
 catch (    InterruptedException ignore) {
    }
  }
}
Program: 116347
Project: 116347
Buggy source:
private boolean getAllClusterInSameState(Map<String,ClusterDataHolder> clusterData,ClusterStatus status){
  boolean clusterStat=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() == status) {
      clusterStat=true;
    }
 else {
      clusterStat=false;
      return clusterStat;
    }
  }
  return clusterStat;
}

Fixed version (ground truth):
private boolean getAllClusterInSameState(Map<String,ClusterDataHolder> clusterData,ClusterStatus status){
  boolean clusterStat=false;
  for (  Map.Entry<String,ClusterDataHolder> clusterDataHolderEntry : clusterData.entrySet()) {
    String serviceName=clusterDataHolderEntry.getValue().getServiceType();
    String clusterId=clusterDataHolderEntry.getValue().getClusterId();
    TopologyManager.acquireReadLockForCluster(serviceName,clusterId);
    try {
      Service service=TopologyManager.getTopology().getService(serviceName);
      Cluster cluster=service.getCluster(clusterId);
      if (cluster.getStatus() == status) {
        clusterStat=true;
      }
 else {
        clusterStat=false;
        return clusterStat;
      }
    }
  finally {
      TopologyManager.releaseReadLockForCluster(serviceName,clusterId);
    }
  }
  return clusterStat;
}
Program: 116348
Project: 116348
Buggy source:
private boolean doProcess(ClusterResetEvent event,Topology topology){
  if (TopologyServiceFilter.getInstance().isActive()) {
    if (TopologyServiceFilter.getInstance().serviceNameExcluded(event.getServiceName())) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",event.getServiceName()));
      }
      return false;
    }
  }
  if (TopologyClusterFilter.getInstance().isActive()) {
    if (TopologyClusterFilter.getInstance().clusterIdExcluded(event.getClusterId())) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",event.getClusterId()));
      }
      return false;
    }
  }
  Service service=topology.getService(event.getServiceName());
  if (service == null) {
    if (log.isWarnEnabled()) {
      log.warn(String.format("String_Node_Str",event.getServiceName()));
    }
    return false;
  }
  if (service.clusterExists(event.getClusterId())) {
    if (log.isWarnEnabled()) {
      log.warn(String.format("String_Node_Str",event.getServiceName(),event.getClusterId()));
    }
  }
 else {
    Cluster cluster=service.getCluster(event.getClusterId());
    if (!cluster.isStateTransitionValid(ClusterStatus.Created)) {
      log.error("String_Node_Str" + cluster.getStatus() + "String_Node_Str"+ ClusterStatus.Created+ "String_Node_Str"+ "String_Node_Str"+ cluster.getClusterId());
    }
    cluster.setStatus(ClusterStatus.Created);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",cluster.toString()));
    }
  }
  notifyEventListeners(event);
  return true;
}

Fixed version (ground truth):
private boolean doProcess(ClusterResetEvent event,Topology topology){
  if (TopologyServiceFilter.getInstance().isActive()) {
    if (TopologyServiceFilter.getInstance().serviceNameExcluded(event.getServiceName())) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",event.getServiceName()));
      }
      return false;
    }
  }
  if (TopologyClusterFilter.getInstance().isActive()) {
    if (TopologyClusterFilter.getInstance().clusterIdExcluded(event.getClusterId())) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",event.getClusterId()));
      }
      return false;
    }
  }
  Service service=topology.getService(event.getServiceName());
  if (service == null) {
    if (log.isWarnEnabled()) {
      log.warn(String.format("String_Node_Str",event.getServiceName()));
    }
    return false;
  }
  Cluster cluster=service.getCluster(event.getClusterId());
  if (cluster == null) {
    if (log.isWarnEnabled()) {
      log.warn(String.format("String_Node_Str",event.getServiceName(),event.getClusterId()));
    }
  }
 else {
    if (!cluster.isStateTransitionValid(ClusterStatus.Created)) {
      log.error("String_Node_Str" + cluster.getStatus() + "String_Node_Str"+ ClusterStatus.Created);
    }
    cluster.setStatus(ClusterStatus.Created);
  }
  notifyEventListeners(event);
  return true;
}
Program: 116349
Project: 116349
Buggy source:
private static void publish(Event event){
  EventPublisher instanceNotifyingEvent=EventPublisherPool.getPublisher(Constants.INSTANCE_NOTIFIER_TOPIC);
  instanceNotifyingEvent.publish(event);
}

Fixed version (ground truth):
private static void publish(Event event){
  String topic=Util.getMessageTopicName(event);
  EventPublisher instanceNotifyingEvent=EventPublisherPool.getPublisher(topic);
  instanceNotifyingEvent.publish(event);
}
Program: 116350
Project: 116350
Buggy source:
@Override public void messageArrived(String topicName,MqttMessage message) throws Exception {
  TextMessage receivedMessage=new ActiveMQTextMessage();
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str"));
  }
  receivedMessage.setText(new String(message.getPayload()));
  receivedMessage.setStringProperty(Constants.EVENT_CLASS_NAME,Util.getEventNameForTopic(topicName));
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",((TextMessage)message).getText()));
    }
    messageQueue.add(receivedMessage);
  }
 catch (  JMSException e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void messageArrived(String topicName,MqttMessage message) throws Exception {
  TextMessage receivedMessage=new ActiveMQTextMessage();
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str"));
  }
  receivedMessage.setText(new String(message.getPayload()));
  receivedMessage.setStringProperty(Constants.EVENT_CLASS_NAME,Util.getEventNameForTopic(topicName));
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",receivedMessage.getText()));
    }
    messageQueue.add(receivedMessage);
  }
 catch (  JMSException e) {
    log.error(e.getMessage(),e);
  }
}
Program: 116351
Project: 116351
Buggy source:
@Override public void messageArrived(String topicName,MqttMessage message) throws Exception {
  TextMessage receivedMessage=new ActiveMQTextMessage();
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str"));
  }
  receivedMessage.setText(new String(message.getPayload()));
  receivedMessage.setStringProperty(Constants.EVENT_CLASS_NAME,Util.getEventNameForTopic(topicName));
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",((TextMessage)message).getText()));
    }
    messageQueue.add(receivedMessage);
  }
 catch (  JMSException e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void messageArrived(String topicName,MqttMessage message) throws Exception {
  TextMessage receivedMessage=new ActiveMQTextMessage();
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str"));
  }
  receivedMessage.setText(new String(message.getPayload()));
  receivedMessage.setStringProperty(Constants.EVENT_CLASS_NAME,Util.getEventNameForTopic(topicName));
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",receivedMessage.getText()));
    }
    messageQueue.add(receivedMessage);
  }
 catch (  JMSException e) {
    log.error(e.getMessage(),e);
  }
}
Program: 116352
Project: 116352
Buggy source:
public static void sendCompleteApplicationsEvent(Applications completeApplications){
  publishEvent(new CompleteApplicationsEvent(completeApplications));
}

Fixed version (ground truth):
public static void sendCompleteApplicationsEvent(Applications completeApplications){
}
Program: 116353
Project: 116353
Buggy source:
public static void main(String[] args){
  try {
    final Thread mainThread=Thread.currentThread();
    Runtime.getRuntime().addShutdownHook(new Thread(){
      public void run(){
        try {
          EventPublisherPool.close(Constants.INSTANCE_STATUS_TOPIC);
          mainThread.join();
        }
 catch (        Exception e) {
          log.error(e);
        }
      }
    }
);
    CartridgeAgentConfiguration.getInstance();
    if (args.length >= 1) {
      String className=args[0];
      try {
        Constructor<?> c=Class.forName(className).getConstructor();
        cartridgeAgent=(CartridgeAgent)c.newInstance();
        log.info("String_Node_Str" + className);
      }
 catch (      Exception e) {
        String msg=String.format("String_Node_Str" + "String_Node_Str",className);
        log.warn(msg,e);
      }
    }
    if (cartridgeAgent == null) {
      cartridgeAgent=new CartridgeAgent();
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
    }
    Thread thread=new Thread(cartridgeAgent);
    thread.start();
  }
 catch (  Exception e) {
    if (log.isErrorEnabled()) {
      log.error(e);
    }
    if (cartridgeAgent != null) {
      cartridgeAgent.terminate();
    }
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    final Thread mainThread=Thread.currentThread();
    Runtime.getRuntime().addShutdownHook(new Thread(){
      public void run(){
        try {
          EventPublisherPool.close(Constants.INSTANCE_STATUS_TOPIC);
          mainThread.join();
        }
 catch (        Exception e) {
          log.error(e);
        }
      }
    }
);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    PropertyConfigurator.configure(System.getProperty("String_Node_Str"));
    CartridgeAgentConfiguration.getInstance();
    if (args.length >= 1) {
      String className=args[0];
      try {
        Constructor<?> c=Class.forName(className).getConstructor();
        cartridgeAgent=(CartridgeAgent)c.newInstance();
        log.info("String_Node_Str" + className);
      }
 catch (      Exception e) {
        String msg=String.format("String_Node_Str" + "String_Node_Str",className);
        log.warn(msg,e);
      }
    }
    if (cartridgeAgent == null) {
      cartridgeAgent=new CartridgeAgent();
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
    }
    Thread thread=new Thread(cartridgeAgent);
    thread.start();
  }
 catch (  Exception e) {
    if (log.isErrorEnabled()) {
      log.error(e);
    }
    if (cartridgeAgent != null) {
      cartridgeAgent.terminate();
    }
  }
}
Program: 116354
Project: 116354
Buggy source:
protected void activate(ComponentContext context){
  try {
    TopicSubscriber subscriber=new TopicSubscriber(CloudControllerConstants.INSTANCE_TOPIC);
    subscriber.setMessageListener(new InstanceStatusEventMessageListener());
    Thread tsubscriber=new Thread(subscriber);
    tsubscriber.start();
    InstanceStatusEventMessageDelegator delegator=new InstanceStatusEventMessageDelegator();
    Thread tdelegator=new Thread(delegator);
    tdelegator.start();
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    applicationTopicReceiver=new ApplicationTopicReceiver();
    Thread tApplicationTopicReceiver=new Thread(applicationTopicReceiver);
    tApplicationTopicReceiver.start();
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    clusterStatusTopicReceiver=new ClusterStatusTopicReceiver();
    Thread tClusterStatusTopicReceiver=new Thread(clusterStatusTopicReceiver);
    tClusterStatusTopicReceiver.start();
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    BundleContext bundleContext=context.getBundleContext();
    bundleContext.registerService(CloudControllerService.class.getName(),new CloudControllerServiceImpl(),null);
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    TopologySynchronizerTaskScheduler.schedule(ServiceReferenceHolder.getInstance().getTaskService());
  }
 catch (  Throwable e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
protected void activate(ComponentContext context){
  try {
    applicationTopicReceiver=new ApplicationTopicReceiver();
    Thread tApplicationTopicReceiver=new Thread(applicationTopicReceiver);
    tApplicationTopicReceiver.start();
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    clusterStatusTopicReceiver=new ClusterStatusTopicReceiver();
    Thread tClusterStatusTopicReceiver=new Thread(clusterStatusTopicReceiver);
    tClusterStatusTopicReceiver.start();
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    instanceStatusTopicReceiver=new InstanceStatusTopicReceiver();
    Thread tInstanceStatusTopicReceiver=new Thread(instanceStatusTopicReceiver);
    tInstanceStatusTopicReceiver.start();
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    BundleContext bundleContext=context.getBundleContext();
    bundleContext.registerService(CloudControllerService.class.getName(),new CloudControllerServiceImpl(),null);
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str");
    }
    TopologySynchronizerTaskScheduler.schedule(ServiceReferenceHolder.getInstance().getTaskService());
  }
 catch (  Throwable e) {
    log.error("String_Node_Str",e);
  }
}
Program: 116355
Project: 116355
Buggy source:
@Override public void run(){
  this.applicationsEventReceiver=new ApplicationsEventReceiver();
  addEventListeners();
}

Fixed version (ground truth):
@Override public void run(){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
  Thread thread=new Thread(applicationsEventReceiver);
  thread.start();
  while (!terminated) {
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException ignore) {
    }
  }
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
}
Program: 116356
Project: 116356
Buggy source:
public ClusterStatusTopicReceiver(){
  this.statusEventReceiver=new ClusterStatusEventReceiver();
  addEventListeners();
}

Fixed version (ground truth):
public ClusterStatusTopicReceiver(){
  this.statusEventReceiver=new ClusterStatusEventReceiver();
}
Program: 116357
Project: 116357
Buggy source:
public void run(){
  try {
    Thread.sleep(15000);
  }
 catch (  InterruptedException ignore) {
  }
  Thread thread=new Thread(statusEventReceiver);
  thread.start();
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
  while (!terminated) {
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException ignore) {
    }
  }
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
}

Fixed version (ground truth):
public void run(){
  Thread thread=new Thread(statusEventReceiver);
  thread.start();
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
  while (!terminated) {
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException ignore) {
    }
  }
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str");
  }
}