Program: 116418
Project: 116418
Buggy source:
protected void onChildTerminatedEvent(String idOfEvent){
  List<ApplicationContext> terminationList;
  boolean allDependentTerminated=true;
  ApplicationContext context=this.dependencyTree.findApplicationContextWithId(idOfEvent);
  context.setTerminated(true);
  terminationList=this.dependencyTree.getTerminationDependencies(idOfEvent);
  if (terminationList != null) {
    for (    ApplicationContext context1 : terminationList) {
      if (this.aliasToActiveMonitorsMap.containsKey(context1.getId())) {
        log.warn("String_Node_Str" + context1.getId() + "String_Node_Str");
        allDependentTerminated=false;
      }
 else       if (this.aliasToInActiveMonitorsMap.containsKey(context1.getId())) {
        log.info("String_Node_Str" + context1.getId() + "String_Node_Str");
        allDependentTerminated=false;
      }
 else {
        allDependentTerminated=true;
      }
    }
  }
  List<ApplicationContext> parentContexts=this.dependencyTree.findAllParentContextWithId(idOfEvent);
  boolean canStart=false;
  if (parentContexts != null) {
    for (    ApplicationContext context1 : parentContexts) {
      if (this.aliasToInActiveMonitorsMap.containsKey(context1.getId())) {
        log.info("String_Node_Str" + context1.getId() + "String_Node_Str");
        canStart=false;
      }
 else       if (this.aliasToActiveMonitorsMap.containsKey(context1.getId())) {
        if (canStart) {
          log.warn("String_Node_Str" + context1.getId() + "String_Node_Str");
        }
      }
 else {
        log.info("String_Node_Str" + context1.getId() + "String_Node_Str");
        canStart=true;
      }
    }
  }
  if ((terminationList != null && allDependentTerminated || terminationList == null) && (parentContexts != null && canStart || parentContexts == null)) {
    try {
      this.startDependencyOnTermination();
    }
 catch (    TopologyInConsistentException e) {
      log.error("String_Node_Str" + e);
    }
  }
 else {
    StatusChecker.getInstance().onChildStatusChange(idOfEvent,this.id,this.appId);
    log.info("String_Node_Str" + idOfEvent + "String_Node_Str");
  }
}

Fixed version (ground truth):
protected void onChildTerminatedEvent(String idOfEvent){
  List<ApplicationContext> terminationList;
  boolean allDependentTerminated=true;
  ApplicationContext context=this.dependencyTree.findApplicationContextWithId(idOfEvent);
  context.setTerminated(true);
  terminationList=this.dependencyTree.getTerminationDependencies(idOfEvent);
  if (terminationList != null) {
    allDependentTerminated=allDependentTerminated(terminationList);
  }
  List<ApplicationContext> parentContexts=this.dependencyTree.findAllParentContextWithId(idOfEvent);
  boolean parentsTerminated=false;
  if (parentContexts != null) {
    parentsTerminated=allParentTerminated(parentContexts);
  }
  if ((terminationList != null && allDependentTerminated || terminationList == null) && (parentContexts != null && parentsTerminated || parentContexts == null)) {
    try {
      this.startDependencyOnTermination();
    }
 catch (    TopologyInConsistentException e) {
      log.error("String_Node_Str" + e);
    }
  }
 else {
    StatusChecker.getInstance().onChildStatusChange(idOfEvent,this.id,this.appId);
    log.info("String_Node_Str" + "String_Node_Str");
  }
}