Program: 116206
Project: 116206
Buggy source:
@Override public void onChildStatusEvent(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  String instanceId=statusEvent.getInstanceId();
  LifeCycleState status1=statusEvent.getStatus();
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(id,instanceId);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    this.markMonitorAsInactive(id);
    onChildInactiveEvent(id,instanceId);
  }
 else   if (status1 == ClusterStatus.Created || status1 == GroupStatus.Created) {
    if (this.terminatingMonitorsList.contains(id)) {
      this.terminatingMonitorsList.remove(id);
      this.aliasToActiveMonitorsMap.remove(id);
      if (AutoscalerContext.getInstance().getClusterMonitors().containsKey(id)) {
        AutoscalerContext.getInstance().removeClusterMonitor(id);
      }
    }
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    this.markMonitorAsTerminating(id);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.terminatingMonitorsList.contains(id)) {
      this.terminatingMonitorsList.remove(id);
      this.aliasToActiveMonitorsMap.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    ApplicationHolder.releaseReadLock();
    GroupStatus instanceStatus;
    try {
      Group group=ApplicationHolder.getApplications().getApplication(appId).getGroupRecursively(this.id);
      instanceStatus=group.getInstanceContexts(instanceId).getStatus();
    }
  finally {
      ApplicationHolder.releaseReadLock();
    }
    if (instanceStatus == GroupStatus.Terminating) {
      ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(this.id,appId,instanceId);
    }
 else {
      onChildTerminatedEvent(id,instanceId);
    }
  }
}

Fixed version (ground truth):
@Override public void onChildStatusEvent(MonitorStatusEvent statusEvent){
  String id=statusEvent.getId();
  String instanceId=statusEvent.getInstanceId();
  LifeCycleState status1=statusEvent.getStatus();
  if (status1 == ClusterStatus.Active || status1 == GroupStatus.Active) {
    onChildActivatedEvent(id,instanceId);
  }
 else   if (status1 == ClusterStatus.Inactive || status1 == GroupStatus.Inactive) {
    this.markMonitorAsInactive(instanceId);
    onChildInactiveEvent(id,instanceId);
  }
 else   if (status1 == ClusterStatus.Created || status1 == GroupStatus.Created) {
    if (this.terminatingMonitorsList.contains(instanceId)) {
      this.terminatingMonitorsList.remove(instanceId);
      this.aliasToActiveMonitorsMap.remove(instanceId);
      if (AutoscalerContext.getInstance().getClusterMonitors().containsKey(id)) {
        AutoscalerContext.getInstance().removeClusterMonitor(id);
      }
    }
  }
 else   if (status1 == ClusterStatus.Terminating || status1 == GroupStatus.Terminating) {
    this.markMonitorAsTerminating(instanceId);
  }
 else   if (status1 == ClusterStatus.Terminated || status1 == GroupStatus.Terminated) {
    if (this.terminatingMonitorsList.contains(id)) {
      this.terminatingMonitorsList.remove(id);
      this.aliasToActiveMonitorsMap.remove(id);
    }
 else {
      log.warn("String_Node_Str" + id + "String_Node_Str");
    }
    ApplicationHolder.releaseReadLock();
    GroupStatus instanceStatus;
    try {
      Group group=ApplicationHolder.getApplications().getApplication(appId).getGroupRecursively(this.id);
      instanceStatus=group.getInstanceContexts(instanceId).getStatus();
    }
  finally {
      ApplicationHolder.releaseReadLock();
    }
    if (instanceStatus == GroupStatus.Terminating) {
      ServiceReferenceHolder.getInstance().getGroupStatusProcessorChain().process(this.id,appId,instanceId);
    }
 else {
      onChildTerminatedEvent(id,instanceId);
    }
  }
}