nus-yam/ex-repair huggingface dataset:
Program: 116432
Project: 116432
Buggy source:
public static void sendGroupInActivateEvent(String appId,String groupId){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str" + appId + "String_Node_Str"+ groupId);
  }
  AppStatusGroupInactivateEvent appStatusGroupInactivateEvent=new AppStatusGroupInactivateEvent(appId,groupId);
  publishEvent(appStatusGroupInactivateEvent);
}

Fixed version (ground truth):
public static void sendGroupInActivateEvent(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.Inactive)) {
        AppStatusGroupInactivateEvent appStatusGroupInactivateEvent=new AppStatusGroupInactivateEvent(appId,groupId);
        publishEvent(appStatusGroupInactivateEvent);
      }
 else {
        log.warn("String_Node_Str" + groupId);
      }
    }
  }
  finally {
    TopologyManager.releaseReadLockForApplication(appId);
  }
}
Program: 116434
Project: 116434
Buggy source:
protected void onChildInActiveEvent(String idOfEvent){
  List<ApplicationContext> terminationList;
  Monitor monitor;
  this.aliasToInActiveMonitorsMap.put(idOfEvent,this.aliasToActiveMonitorsMap.remove(idOfEvent));
  if (this.hasDependent) {
    StatusChecker.getInstance().onChildStatusChange(idOfEvent,this.id,this.appId);
  }
 else {
    terminationList=this.dependencyTree.getTerminationDependencies(idOfEvent);
    if (this.hasInDependentChild()) {
      if (this.parent != null) {
        StatusEventPublisher.sendGroupInActivateEvent(this.appId,this.id);
      }
    }
    if (terminationList != null) {
      for (      ApplicationContext terminationContext : terminationList) {
        monitor=this.aliasToActiveMonitorsMap.get(terminationContext.getId());
        if (monitor != null) {
          if (monitor.hasActiveMonitors()) {
            StatusEventPublisher.sendGroupTerminatingEvent(this.appId,terminationContext.getId());
          }
 else {
            StatusEventPublisher.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" + idOfEvent + "String_Node_Str"+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
protected void onChildInActiveEvent(String idOfEvent){
  List<ApplicationContext> terminationList;
  Monitor monitor;
  if (this.hasDependent) {
    StatusChecker.getInstance().onChildStatusChange(idOfEvent,this.id,this.appId);
  }
 else {
    terminationList=this.dependencyTree.getTerminationDependencies(idOfEvent);
    if (this.hasInDependentChild()) {
      if (this.parent != null) {
        StatusEventPublisher.sendGroupInActivateEvent(this.appId,this.id);
      }
    }
    if (terminationList != null) {
      for (      ApplicationContext terminationContext : terminationList) {
        monitor=this.aliasToActiveMonitorsMap.get(terminationContext.getId());
        if (monitor != null) {
          if (monitor.hasActiveMonitors()) {
            StatusEventPublisher.sendGroupTerminatingEvent(this.appId,terminationContext.getId());
          }
 else {
            StatusEventPublisher.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" + idOfEvent + "String_Node_Str"+ "String_Node_Str");
    }
  }
}
Program: 116436
Project: 116436
Buggy source:
@Override protected void monitor(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) {
    onChildTerminatingEvent(id);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    this.aliasToInActiveMonitorsMap.remove(id);
    if (this.status != ApplicationStatus.Terminating && !this.aliasToInActiveMonitorsMap.isEmpty() && !this.aliasToActiveMonitorsMap.isEmpty()) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}

Fixed version (ground truth):
@Override protected void monitor(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) {
    onChildTerminatingEvent(id);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    this.aliasToInActiveMonitorsMap.remove(id);
    if (this.status != ApplicationStatus.Terminating) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}
Program: 116437
Project: 116437
Buggy source:
@Override public void run(){
  while (!isDestroyed()) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + this.toString());
    }
    try {
      if ((this.status.getCode() <= ClusterStatus.Active.getCode()) || (this.status == ClusterStatus.Inactive && !hasDependent)) {
        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(monitorInterval);
    }
 catch (    InterruptedException ignore) {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (!isDestroyed()) {
    try {
      if ((this.status.getCode() <= ClusterStatus.Active.getCode()) || (this.status == ClusterStatus.Inactive && !hasDependent)) {
        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(monitorInterval);
    }
 catch (    InterruptedException ignore) {
    }
  }
}
Program: 116438
Project: 116438
Buggy source:
@Override protected void monitor(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);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    onChildTerminatingEvent(id);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    this.aliasToInActiveMonitorsMap.remove(id);
    if (this.status != GroupStatus.Terminating && !this.aliasToInActiveMonitorsMap.isEmpty() && !this.aliasToActiveMonitorsMap.isEmpty()) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}

Fixed version (ground truth):
@Override protected void monitor(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);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    onChildTerminatingEvent(id);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    this.aliasToInActiveMonitorsMap.remove(id);
    if (this.status != GroupStatus.Terminating) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}
Program: 116441
Project: 116441
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 (this.killDependent) {
    findAllChildrenOfAppContext(applicationContext.getApplicationContextList(),allChildrenOfAppContext);
    return allChildrenOfAppContext;
  }
 else   if (this.killAll) {
    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);
  if (this.killDependent) {
    allChildrenOfAppContext.add(applicationContext);
    findAllChildrenOfAppContext(applicationContext.getApplicationContextList(),allChildrenOfAppContext);
    return allChildrenOfAppContext;
  }
 else   if (this.killAll) {
    findAllChildrenOfAppContext(this.applicationContextList,allChildrenOfAppContext);
  }
  return allChildrenOfAppContext;
}
Program: 116442
Project: 116442
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;
  MonitorStatusEventBuilder.handleGroupStatusEvent(this.parent,this.status,this.id);
}

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){
  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 {
    MonitorStatusEventBuilder.handleGroupStatusEvent(this.parent,this.status,this.id);
  }
}
Program: 116444
Project: 116444
Buggy source:
@Override public boolean process(String type,String message,Object object){
  if (ApplicationCreatedEvent.class.getName().equals(type)) {
    ApplicationCreatedEvent event=(ApplicationCreatedEvent)Util.jsonToObject(message,ApplicationCreatedEvent.class);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + event.toString());
    }
    notifyEventListeners(event);
    return true;
  }
 else {
    if (nextProcessor != null) {
      return nextProcessor.process(type,message,object);
    }
 else {
      throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str",type,message));
    }
  }
}

Fixed version (ground truth):
@Override public boolean process(String type,String message,Object object){
  if (AppStatusApplicationCreatedEvent.class.getName().equals(type)) {
    AppStatusApplicationCreatedEvent event=(AppStatusApplicationCreatedEvent)Util.jsonToObject(message,AppStatusApplicationCreatedEvent.class);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + event.toString());
    }
    notifyEventListeners(event);
    return true;
  }
 else {
    if (nextProcessor != null) {
      return nextProcessor.process(type,message,object);
    }
 else {
      throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str",type,message));
    }
  }
}
Program: 116445
Project: 116445
Buggy source:
protected void onChildInActiveEvent(String idOfEvent){
  List<ApplicationContext> terminationList;
  Monitor monitor;
  if (this.hasDependent) {
    StatusChecker.getInstance().onChildStatusChange(idOfEvent,this.id,this.appId);
  }
 else {
    terminationList=this.dependencyTree.getTerminationDependencies(idOfEvent);
    if (this.hasInDependentChild()) {
      if (this.parent != null) {
        StatusEventPublisher.sendGroupInActivateEvent(this.appId,this.id);
      }
    }
    if (terminationList != null) {
      for (      ApplicationContext terminationContext : terminationList) {
        monitor=this.aliasToActiveMonitorsMap.get(terminationContext.getId());
        if (monitor != null) {
          if (monitor.hasActiveMonitors()) {
            StatusEventPublisher.sendGroupTerminatingEvent(this.appId,terminationContext.getId());
          }
 else {
            StatusEventPublisher.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" + idOfEvent + "String_Node_Str"+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
protected void onChildInActiveEvent(String idOfEvent){
  List<ApplicationContext> terminationList;
  Monitor monitor;
  if (this.hasDependent) {
    StatusChecker.getInstance().onChildStatusChange(idOfEvent,this.id,this.appId);
  }
 else {
    terminationList=this.dependencyTree.getTerminationDependencies(idOfEvent);
    if (terminationList.size() == (this.aliasToActiveMonitorsMap.size() + this.aliasToInActiveMonitorsMap.size())) {
      if (this.parent != null) {
        StatusEventPublisher.sendGroupTerminatingEvent(this.appId,this.id);
      }
    }
 else {
      if (this.parent != null) {
        StatusEventPublisher.sendGroupInActivateEvent(this.appId,this.id);
      }
      if (terminationList != null) {
        for (        ApplicationContext terminationContext : terminationList) {
          monitor=this.aliasToActiveMonitorsMap.get(terminationContext.getId());
          if (monitor != null) {
            if (monitor.hasActiveMonitors()) {
              StatusEventPublisher.sendGroupTerminatingEvent(this.appId,terminationContext.getId());
            }
 else {
              StatusEventPublisher.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" + idOfEvent + "String_Node_Str"+ "String_Node_Str");
      }
    }
  }
}
Program: 116446
Project: 116446
Buggy source:
@Override protected void monitor(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) {
    onChildTerminatingEvent(id);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    this.aliasToInActiveMonitorsMap.remove(id);
    if (this.status != ApplicationStatus.Terminating) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}

Fixed version (ground truth):
@Override protected void monitor(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) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}
Program: 116447
Project: 116447
Buggy source:
@Override protected void monitor(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);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    onChildTerminatingEvent(id);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    this.aliasToInActiveMonitorsMap.remove(id);
    if (this.status != GroupStatus.Terminating) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}

Fixed version (ground truth):
@Override protected void monitor(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);
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    this.aliasToInActiveMonitorsMap.remove(id);
    if (this.status != GroupStatus.Terminating) {
      onChildTerminatedEvent(id);
    }
 else {
      StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
      log.info("String_Node_Str" + id);
    }
  }
}
Program: 116448
Project: 116448
Buggy source:
private void handleMemberFaultEvent(String clusterId,String memberId){
  try {
    AbstractClusterMonitor monitor=getMonitor(clusterId);
    NetworkPartitionContext nwPartitionCtxt;
    TopologyManager.acquireReadLockForServices();
    try {
      Member member=findMember(memberId);
      if (null == member) {
        return;
      }
      if (!member.isActive()) {
        if (log.isDebugEnabled()) {
          log.debug(String.format("String_Node_Str" + "String_Node_Str",memberId));
        }
        return;
      }
      if (monitor != null) {
        nwPartitionCtxt=monitor.getNetworkPartitionCtxt(member);
      }
 else {
        return;
      }
    }
  finally {
      TopologyManager.releaseReadLockForServices();
    }
    String partitionId=monitor.getPartitionOfMember(memberId);
    PartitionContext partitionCtxt=nwPartitionCtxt.getPartitionCtxt(partitionId);
    if (!partitionCtxt.activeMemberExist(memberId)) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",memberId));
      }
      return;
    }
    CloudControllerClient ccClient=CloudControllerClient.getInstance();
    ccClient.terminate(memberId);
    partitionCtxt.removeActiveMemberById(memberId);
    StatusChecker.getInstance().onMemberFaultEvent(clusterId,"String_Node_Str",partitionCtxt);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",memberId,partitionId,clusterId));
    }
  }
 catch (  TerminationException e) {
    log.error(e);
  }
}

Fixed version (ground truth):
private void handleMemberFaultEvent(String clusterId,String memberId){
  try {
    AbstractClusterMonitor monitor=getMonitor(clusterId);
    NetworkPartitionContext nwPartitionCtxt;
    TopologyManager.acquireReadLockForServices();
    try {
      Member member=findMember(memberId);
      if (null == member) {
        return;
      }
      if (!member.isActive()) {
        if (log.isDebugEnabled()) {
          log.debug(String.format("String_Node_Str" + "String_Node_Str",memberId));
        }
        return;
      }
      if (monitor != null) {
        nwPartitionCtxt=monitor.getNetworkPartitionCtxt(member);
      }
 else {
        return;
      }
    }
  finally {
      TopologyManager.releaseReadLockForServices();
    }
    String partitionId=monitor.getPartitionOfMember(memberId);
    PartitionContext partitionCtxt=nwPartitionCtxt.getPartitionCtxt(partitionId);
    if (!partitionCtxt.activeMemberExist(memberId)) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",memberId));
      }
      return;
    }
    CloudControllerClient ccClient=CloudControllerClient.getInstance();
    ccClient.terminate(memberId);
    partitionCtxt.removeActiveMemberById(memberId);
    StatusChecker.getInstance().onMemberFaultEvent(clusterId,partitionCtxt);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",memberId,partitionId,clusterId));
    }
  }
 catch (  TerminationException e) {
    log.error(e);
  }
}
Program: 116449
Project: 116449
Buggy source:
/** 
 * @param clusterId
 * @param appId
 * @param partitionContext is to decide in which partition has less members while others have active members
 */
public void onMemberFaultEvent(final String clusterId,final String appId,final PartitionContext partitionContext){
  ClusterMonitor monitor=(ClusterMonitor)AutoscalerContext.getInstance().getMonitor(clusterId);
  boolean clusterInActive=getClusterInActive(monitor,partitionContext);
  if (clusterInActive) {
    StatusEventPublisher.sendClusterInActivateEvent(appId,monitor.getServiceId(),clusterId);
  }
 else {
    boolean clusterActive=clusterActive(monitor);
    if (clusterActive) {
    }
  }
}

Fixed version (ground truth):
/** 
 * @param clusterId
 * @param partitionContext is to decide in which partition has less members while others have active members
 */
public void onMemberFaultEvent(final String clusterId,final PartitionContext partitionContext){
  ClusterMonitor monitor=(ClusterMonitor)AutoscalerContext.getInstance().getMonitor(clusterId);
  boolean clusterInActive=getClusterInActive(monitor,partitionContext);
  String appId=monitor.getAppId();
  if (clusterInActive) {
    StatusEventPublisher.sendClusterInActivateEvent(appId,monitor.getServiceId(),clusterId);
  }
 else {
    boolean clusterActive=clusterActive(monitor);
    if (clusterActive) {
    }
  }
}
Program: 116451
Project: 116451
Buggy source:
public void run(){
  ClusterContext ctxt=dataHolder.getClusterContext(clusterId_);
  if (ctxt == null) {
    String msg="String_Node_Str" + clusterId_;
    LOG.error(msg);
  }
  Collection<Member> members=TopologyManager.getTopology().getService(ctxt.getCartridgeType()).getCluster(clusterId_).getMembers();
  while (members.size() > 0) {
    CloudControllerUtil.sleep(1000);
  }
  LOG.info("String_Node_Str" + clusterId_);
  deleteVolumes(ctxt);
  onClusterRemoval(clusterId_);
}

Fixed version (ground truth):
public void run(){
  ClusterContext ctxt=dataHolder.getClusterContext(clusterId_);
  if (ctxt == null) {
    String msg="String_Node_Str" + clusterId_;
    LOG.error(msg);
    return;
  }
  Collection<Member> members=TopologyManager.getTopology().getService(ctxt.getCartridgeType()).getCluster(clusterId_).getMembers();
  while (members.size() > 0) {
    CloudControllerUtil.sleep(1000);
  }
  LOG.info("String_Node_Str" + clusterId_);
  deleteVolumes(ctxt);
  onClusterRemoval(clusterId_);
}
Program: 116452
Project: 116452
Buggy source:
@Override public boolean process(String type,String message,Object object){
  Topology topology=(Topology)object;
  if (ApplicationTerminatedEvent.class.getName().equals(type)) {
    if (!topology.isInitialized())     return false;
    ApplicationTerminatedEvent event=(ApplicationTerminatedEvent)Util.jsonToObject(message,ApplicationTerminatedEvent.class);
    TopologyUpdater.acquireWriteLockForApplication(event.getAppId());
    Set<ClusterDataHolder> clusterDataHolders=event.getClusterData();
    if (clusterDataHolders != null) {
      for (      ClusterDataHolder clusterData : clusterDataHolders) {
        TopologyUpdater.acquireWriteLockForService(clusterData.getServiceType());
      }
    }
    try {
      return doProcess(event,topology);
    }
  finally {
      TopologyUpdater.releaseWriteLockForApplication(event.getAppId());
      if (clusterDataHolders != null) {
        for (        ClusterDataHolder clusterData : clusterDataHolders) {
          TopologyUpdater.releaseWriteLockForService(clusterData.getServiceType());
        }
      }
    }
  }
 else {
    if (nextProcessor != null) {
      return nextProcessor.process(type,message,topology);
    }
 else {
      throw new RuntimeException(String.format("String_Node_Str",type,message));
    }
  }
}

Fixed version (ground truth):
@Override public boolean process(String type,String message,Object object){
  Topology topology=(Topology)object;
  if (ApplicationTerminatedEvent.class.getName().equals(type)) {
    if (!topology.isInitialized())     return false;
    ApplicationTerminatedEvent event=(ApplicationTerminatedEvent)Util.jsonToObject(message,ApplicationTerminatedEvent.class);
    TopologyUpdater.acquireWriteLockForApplications();
    Set<ClusterDataHolder> clusterDataHolders=event.getClusterData();
    if (clusterDataHolders != null) {
      for (      ClusterDataHolder clusterData : clusterDataHolders) {
        TopologyUpdater.acquireWriteLockForService(clusterData.getServiceType());
      }
    }
    try {
      return doProcess(event,topology);
    }
  finally {
      TopologyUpdater.releaseWriteLockForApplications();
      if (clusterDataHolders != null) {
        for (        ClusterDataHolder clusterData : clusterDataHolders) {
          TopologyUpdater.releaseWriteLockForService(clusterData.getServiceType());
        }
      }
    }
  }
 else {
    if (nextProcessor != null) {
      return nextProcessor.process(type,message,topology);
    }
 else {
      throw new RuntimeException(String.format("String_Node_Str",type,message));
    }
  }
}
Program: 116453
Project: 116453
Buggy source:
@Override public void connectionLost(Throwable arg0){
}

Fixed version (ground truth):
@Override public void connectionLost(Throwable throwable){
  log.warn("String_Node_Str",throwable);
}
Program: 116454
Project: 116454
Buggy source:
@Override public void messageArrived(String topicName,MqttMessage message) throws Exception {
  if (message instanceof MqttMessage) {
    TextMessage receivedMessage=new ActiveMQTextMessage();
    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 textMessage=new ActiveMQTextMessage();
  textMessage.setText(new String(message.getPayload()));
  textMessage.setStringProperty(Constants.EVENT_CLASS_NAME,Util.getEventNameForTopic(topicName));
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("String_Node_Str",textMessage.getText()));
    }
    messageQueue.add(textMessage);
  }
 catch (  JMSException e) {
    log.error(e.getMessage(),e);
  }
}
Program: 116455
Project: 116455
Buggy source:
@Override public void deliveryComplete(IMqttDeliveryToken arg0){
}

Fixed version (ground truth):
@Override public void deliveryComplete(IMqttDeliveryToken deliveryToken){
  if (log.isDebugEnabled()) {
    log.debug(String.format("String_Node_Str",((deliveryToken != null) ? deliveryToken.toString() : "String_Node_Str")));
  }
}
Program: 116456
Project: 116456
Buggy source:
public AbstractClusterMonitor(){
  readConfigurations();
}

Fixed version (ground truth):
public AbstractClusterMonitor(){
  readConfigurations();
  status=ClusterStatus.Created;
}
Program: 116457
Project: 116457
Buggy source:
public ClusterMonitor(String clusterId,String serviceId,DeploymentPolicy deploymentPolicy,AutoscalePolicy autoscalePolicy){
  this.clusterId=clusterId;
  this.serviceId=serviceId;
  this.autoscalerRuleEvaluator=new AutoscalerRuleEvaluator();
  this.scaleCheckKnowledgeSession=autoscalerRuleEvaluator.getScaleCheckStatefulSession();
  this.minCheckKnowledgeSession=autoscalerRuleEvaluator.getMinCheckStatefulSession();
  this.terminateDependencyKnowledgeSession=autoscalerRuleEvaluator.getTerminateDependencyStatefulSession();
  this.terminateAllKnowledgeSession=autoscalerRuleEvaluator.getTerminateAllStatefulSession();
  this.deploymentPolicy=deploymentPolicy;
  this.autoscalePolicy=autoscalePolicy;
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + autoscalePolicy);
  }
  networkPartitionCtxts=new ConcurrentHashMap<String,NetworkPartitionContext>();
  status=ClusterStatus.Created;
}

Fixed version (ground truth):
public ClusterMonitor(String clusterId,String serviceId,DeploymentPolicy deploymentPolicy,AutoscalePolicy autoscalePolicy){
  this.clusterId=clusterId;
  this.serviceId=serviceId;
  this.autoscalerRuleEvaluator=new AutoscalerRuleEvaluator();
  this.scaleCheckKnowledgeSession=autoscalerRuleEvaluator.getScaleCheckStatefulSession();
  this.minCheckKnowledgeSession=autoscalerRuleEvaluator.getMinCheckStatefulSession();
  this.terminateDependencyKnowledgeSession=autoscalerRuleEvaluator.getTerminateDependencyStatefulSession();
  this.terminateAllKnowledgeSession=autoscalerRuleEvaluator.getTerminateAllStatefulSession();
  this.deploymentPolicy=deploymentPolicy;
  this.autoscalePolicy=autoscalePolicy;
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + autoscalePolicy);
  }
  networkPartitionCtxts=new ConcurrentHashMap<String,NetworkPartitionContext>();
}
Program: 116458
Project: 116458
Buggy source:
/** 
 * Constructor of GroupMonitor
 * @param group Takes the group from the Topology
 * @throws DependencyBuilderException    throws when couldn't build the Topology
 * @throws TopologyInConsistentException throws when topology is inconsistent
 */
public GroupMonitor(Group group,String appId) throws DependencyBuilderException, TopologyInConsistentException {
  super(group);
  this.appId=appId;
  this.setStatus(group.getStatus());
  startDependency();
}

Fixed version (ground truth):
/** 
 * Constructor of GroupMonitor
 * @param group Takes the group from the Topology
 * @throws DependencyBuilderException    throws when couldn't build the Topology
 * @throws TopologyInConsistentException throws when topology is inconsistent
 */
public GroupMonitor(Group group,String appId) throws DependencyBuilderException, TopologyInConsistentException {
  super(group);
  this.appId=appId;
  this.status=group.getStatus();
  startDependency();
}
Program: 116460
Project: 116460
Buggy source:
public void run(){
  Monitor monitor=null;
  int retries=5;
  boolean success;
  do {
    try {
      Thread.sleep(5000);
    }
 catch (    InterruptedException e1) {
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + context.getId());
    }
    try {
      monitor=ApplicationMonitorFactory.getMonitor(parent,context,appId);
    }
 catch (    DependencyBuilderException e) {
      String msg="String_Node_Str" + context.getId();
      log.warn(msg,e);
      retries--;
    }
catch (    TopologyInConsistentException e) {
      String msg="String_Node_Str" + context.getId();
      log.warn(msg,e);
      retries--;
    }
catch (    PolicyValidationException e) {
      String msg="String_Node_Str" + context.getId();
      log.warn(msg,e);
      retries--;
    }
catch (    PartitionValidationException e) {
      String msg="String_Node_Str" + context.getId();
      log.warn(msg,e);
      retries--;
    }
    success=true;
  }
 while (!success && retries != 0);
  if (monitor == null) {
    String msg="String_Node_Str" + "String_Node_Str" + context.getId();
    log.error(msg);
    throw new RuntimeException(msg);
  }
  AutoscalerContext.getInstance().addMonitor(monitor);
  aliasToActiveMonitorsMap.put(context.getId(),monitor);
  if (log.isInfoEnabled()) {
    log.info(String.format("String_Node_Str",context.getId()));
  }
}

Fixed version (ground truth):
public void run(){
  Monitor monitor=null;
  int retries=5;
  boolean success;
  do {
    try {
      Thread.sleep(5000);
    }
 catch (    InterruptedException e1) {
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + context.getId());
    }
    try {
      monitor=ApplicationMonitorFactory.getMonitor(parent,context,appId);
    }
 catch (    DependencyBuilderException e) {
      String msg="String_Node_Str" + context.getId();
      log.warn(msg,e);
      retries--;
    }
catch (    TopologyInConsistentException e) {
      String msg="String_Node_Str" + context.getId();
      log.warn(msg,e);
      retries--;
    }
catch (    PolicyValidationException e) {
      String msg="String_Node_Str" + context.getId();
      log.warn(msg,e);
      retries--;
    }
catch (    PartitionValidationException e) {
      String msg="String_Node_Str" + context.getId();
      log.warn(msg,e);
      retries--;
    }
    success=true;
  }
 while (!success && retries != 0);
  if (monitor == null) {
    String msg="String_Node_Str" + "String_Node_Str" + context.getId();
    log.error(msg);
    throw new RuntimeException(msg);
  }
  aliasToActiveMonitorsMap.put(context.getId(),monitor);
  if (log.isInfoEnabled()) {
    log.info(String.format("String_Node_Str",context.getId()));
  }
}
Program: 116461
Project: 116461
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) {
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,this.status,this.clusterId);
  }
}

Fixed version (ground truth):
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)) {
    MonitorStatusEventBuilder.handleClusterStatusEvent(this.parent,this.status,this.clusterId);
  }
}
Program: 116463
Project: 116463
Buggy source:
public void setParent(ParentComponentMonitor parent){
  this.parent=parent;
}

Fixed version (ground truth):
public void setParent(ParentComponentMonitor parent){
  this.parent=parent;
  this.appId=parent.getAppId();
}
Program: 116464
Project: 116464
Buggy source:
public ParentComponentMonitor(ParentComponent component) throws DependencyBuilderException {
  aliasToActiveMonitorsMap=new HashMap<String,Monitor>();
  this.id=component.getUniqueIdentifier();
  dependencyTree=DependencyBuilder.getInstance().buildDependency(component);
}

Fixed version (ground truth):
public ParentComponentMonitor(ParentComponent component) throws DependencyBuilderException {
  aliasToActiveMonitorsMap=new HashMap<String,Monitor>();
  aliasToInActiveMonitorsMap=new HashMap<String,Monitor>();
  this.id=component.getUniqueIdentifier();
  dependencyTree=DependencyBuilder.getInstance().buildDependency(component);
}
Program: 116465
Project: 116465
Buggy source:
/** 
 * Retrieves the previous state
 * @return previous state
 */
public T getPreviousState(){
  return stateStack.get(1);
}

Fixed version (ground truth):
/** 
 * Retrieves the previous state
 * @return previous state
 */
public T getPreviousState(){
  return stateStack.get(stateStack.size() - 2);
}
Program: 116466
Project: 116466
Buggy source:
private boolean getClusterStatus(Map<String,ClusterDataHolder> clusterData){
  boolean clusterActiveStatus=false;
  for (  Map.Entry<String,ClusterDataHolder> clusterDataHolderEntry : clusterData.entrySet()) {
    Service service=TopologyManager.getTopology().getService(clusterDataHolderEntry.getValue().getServiceType());
    if (service.getCluster(clusterDataHolderEntry.getValue().getClusterId()).getStatus() == Status.Activated) {
      clusterActiveStatus=true;
    }
 else {
      clusterActiveStatus=false;
    }
  }
  return clusterActiveStatus;
}

Fixed version (ground truth):
private boolean getClusterStatus(Map<String,ClusterDataHolder> clusterData){
  boolean clusterActiveStatus=false;
  for (  Map.Entry<String,ClusterDataHolder> clusterDataHolderEntry : clusterData.entrySet()) {
    Service service=TopologyManager.getTopology().getService(clusterDataHolderEntry.getValue().getServiceType());
    if (service.getCluster(clusterDataHolderEntry.getValue().getClusterId()).getStatus() == Status.Activated) {
      clusterActiveStatus=true;
    }
 else {
      clusterActiveStatus=false;
      break;
    }
  }
  return clusterActiveStatus;
}
Program: 116467
Project: 116467
Buggy source:
/** 
 * @param clusterId1
 */
public void onMemberStatusChange(String clusterId1){
  final String clusterId=clusterId1;
  Runnable exCluster=new Runnable(){
    public void run(){
      ClusterMonitor monitor=AutoscalerContext.getInstance().getMonitor(clusterId);
      boolean clusterActive=false;
      for (      NetworkPartitionContext networkPartitionContext : monitor.getNetworkPartitionCtxts().values()) {
        for (        PartitionContext partitionContext : networkPartitionContext.getPartitionCtxts().values()) {
          if (partitionContext.getMinimumMemberCount() == partitionContext.getActiveMemberCount()) {
            clusterActive=true;
          }
 else           if (partitionContext.getActiveMemberCount() > partitionContext.getMinimumMemberCount()) {
            log.info("String_Node_Str");
            clusterActive=true;
          }
 else {
            clusterActive=false;
          }
        }
      }
      if (clusterActive) {
        StatusEventPublisher.sendClusterActivatedEvent(monitor.getAppId(),monitor.getServiceId(),monitor.getClusterId());
      }
    }
  }
;
  Thread clusterThread=new Thread(exCluster);
  clusterThread.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(String clusterId){
  ClusterMonitor monitor=AutoscalerContext.getInstance().getMonitor(clusterId);
  boolean clusterActive=clusterActive(monitor);
  if (clusterActive) {
    StatusEventPublisher.sendClusterActivatedEvent(monitor.getAppId(),monitor.getServiceId(),monitor.getClusterId());
  }
}
Program: 116468
Project: 116468
Buggy source:
private boolean getGroupStatus(Map<String,Group> groups){
  boolean groupActiveStatus=false;
  for (  Group group : groups.values()) {
    if (group.getStatus() == Status.Activated) {
      groupActiveStatus=true;
    }
 else {
      groupActiveStatus=false;
    }
  }
  return groupActiveStatus;
}

Fixed version (ground truth):
private boolean getGroupStatus(Map<String,Group> groups){
  boolean groupActiveStatus=false;
  for (  Group group : groups.values()) {
    if (group.getStatus() == Status.Activated) {
      groupActiveStatus=true;
    }
 else {
      groupActiveStatus=false;
      break;
    }
  }
  return groupActiveStatus;
}
Program: 116470
Project: 116470
Buggy source:
@Override protected void monitor(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  Status status1=statusEvent.getStatus();
  ApplicationContext context=this.dependencyTree.findApplicationContextWithId(id);
  if (!isParent(id)) {
    if (status1 == Status.Activated) {
      try {
        boolean startDep=startDependency(statusEvent.getId());
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + startDep + "String_Node_Str"+ id);
        }
        if (startDep) {
          context.setCurrentStatus(Status.Created);
          context.addStatusToLIfeCycle(Status.Created);
        }
 else {
          StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
        }
      }
 catch (      TopologyInConsistentException e) {
        log.error(e);
      }
    }
 else     if (status1 == Status.In_Active) {
      List<ApplicationContext> terminationList=new ArrayList<ApplicationContext>();
      terminationList=this.dependencyTree.getTerminationDependencies(id);
      for (      ApplicationContext terminationContext : terminationList) {
      }
    }
 else {
      List<ApplicationContext> dependents=this.dependencyTree.getTerminationDependencies(id);
    }
  }
 else   if (status1 == Status.Created) {
  }
}

Fixed version (ground truth):
@Override protected void monitor(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  Status status1=statusEvent.getStatus();
  ApplicationContext context=this.dependencyTree.findApplicationContextWithId(id);
  if (!isParent(id)) {
    if (status1 == Status.Activated) {
      try {
        boolean startDep=startDependency(statusEvent.getId());
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str" + startDep + "String_Node_Str"+ id);
        }
        if (startDep) {
          context.setCurrentStatus(Status.Created);
          context.addStatusToLIfeCycle(Status.Created);
        }
 else {
          StatusChecker.getInstance().onChildStatusChange(id,this.id,this.appId);
        }
      }
 catch (      TopologyInConsistentException e) {
        log.error(e);
      }
    }
 else     if (status1 == Status.In_Maintenance) {
      List<ApplicationContext> terminationList=new ArrayList<ApplicationContext>();
      terminationList=this.dependencyTree.getTerminationDependencies(id);
      for (      ApplicationContext terminationContext : terminationList) {
      }
    }
 else {
      List<ApplicationContext> dependents=this.dependencyTree.getTerminationDependencies(id);
    }
  }
 else   if (status1 == Status.Created) {
  }
}
Program: 116471
Project: 116471
Buggy source:
private boolean doProcess(GroupActivatedEvent event,Topology topology){
  Application application=topology.getApplication(event.getAppId());
  if (application == null) {
    if (log.isWarnEnabled()) {
      log.warn(String.format("String_Node_Str",event.getAppId()));
    }
    return false;
  }
  Group group=application.getGroupRecursively(event.getGroupId());
  if (group == null) {
    if (log.isWarnEnabled()) {
      log.warn(String.format("String_Node_Str",event.getAppId(),event.getGroupId()));
    }
  }
 else {
    group.setStatus(Status.Activated);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",group.toString()));
    }
  }
  notifyEventListeners(event);
  return true;
}

Fixed version (ground truth):
private boolean doProcess(GroupActivatedEvent event,Topology topology){
  Application application=topology.getApplication(event.getAppId());
  if (application == null) {
    if (log.isWarnEnabled()) {
      log.warn(String.format("String_Node_Str",event.getAppId()));
    }
    return false;
  }
  Group group=application.getGroupRecursively(event.getGroupId());
  if (group == null) {
    if (log.isWarnEnabled()) {
      log.warn(String.format("String_Node_Str",event.getAppId(),event.getGroupId()));
    }
  }
 else {
    group.setStatus(Status.Activated);
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",group.getUniqueIdentifier()));
    }
  }
  notifyEventListeners(event);
  return true;
}
Program: 116472
Project: 116472
Buggy source:
/** 
 * Constructor of GroupMonitor
 * @param group Takes the group from the Topology
 * @throws DependencyBuilderException throws when couldn't build the Topology
 * @throws TopologyInConsistentException throws when topology is inconsistent
 */
public GroupMonitor(Group group) throws DependencyBuilderException, TopologyInConsistentException {
  super(group);
  this.id=group.getAlias();
  startDependency();
}

Fixed version (ground truth):
/** 
 * Constructor of GroupMonitor
 * @param group Takes the group from the Topology
 * @throws DependencyBuilderException throws when couldn't build the Topology
 * @throws TopologyInConsistentException throws when topology is inconsistent
 */
public GroupMonitor(Group group) throws DependencyBuilderException, TopologyInConsistentException {
  super(group);
  this.id=group.getAlias();
  startDependency();
  this.status=Status.Created;
}
Program: 116473
Project: 116473
Buggy source:
@Override protected void monitor(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  ApplicationContext context=this.dependencyTree.findApplicationContextWithId(id);
  if (context.getStatusLifeCycle().isEmpty()) {
    try {
      boolean startDep=startDependency(statusEvent.getId());
      context.setStatus(statusEvent.getStatus());
      context.addStatusToLIfeCycle(statusEvent.getStatus());
      if (!startDep) {
        StatusChecker.getInstance().onChildStatusChange(id,this.component,this.appId);
      }
    }
 catch (    TopologyInConsistentException e) {
      log.error(e);
    }
  }
 else {
  }
}

Fixed version (ground truth):
@Override protected void monitor(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  ApplicationContext context=this.dependencyTree.findApplicationContextWithId(id);
  if (context.getStatusLifeCycle().isEmpty()) {
    try {
      boolean startDep=startDependency(statusEvent.getId());
      log.info("String_Node_Str" + startDep + "String_Node_Str"+ id);
      context.setStatus(statusEvent.getStatus());
      context.addStatusToLIfeCycle(statusEvent.getStatus());
      if (!startDep) {
        StatusChecker.getInstance().onChildStatusChange(id,this.component,this.appId);
      }
    }
 catch (    TopologyInConsistentException e) {
      log.error(e);
    }
  }
 else {
  }
}