Program: 116713
Project: 116713
Buggy source:
private void handleMemberFaultEvent(String clusterId,String memberId){
  try {
    AutoscalerContext asCtx=AutoscalerContext.getInstance();
    AbstractMonitor monitor;
    if (asCtx.moniterExist(clusterId)) {
      monitor=asCtx.getMonitor(clusterId);
    }
 else     if (asCtx.lbMoniterExist(clusterId)) {
      monitor=asCtx.getLBMonitor(clusterId);
    }
 else {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",clusterId));
      }
      return;
    }
    NetworkPartitionContext nwPartitionCtxt;
    try {
      TopologyManager.acquireReadLock();
      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;
      }
      nwPartitionCtxt=monitor.getNetworkPartitionCtxt(member);
    }
  finally {
      TopologyManager.releaseReadLock();
    }
    CloudControllerClient ccClient=CloudControllerClient.getInstance();
    ccClient.terminate(memberId);
    String partitionId=monitor.getPartitionOfMember(memberId);
    Partition partition=monitor.getDeploymentPolicy().getPartitionById(partitionId);
    PartitionContext partitionCtxt=nwPartitionCtxt.getPartitionCtxt(partitionId);
    partitionCtxt.removeActiveMemberById(memberId);
    String lbClusterId=AutoscalerRuleEvaluator.getLbClusterId(partitionCtxt,nwPartitionCtxt);
    partitionCtxt.addPendingMember(ccClient.spawnAnInstance(partition,clusterId,lbClusterId,nwPartitionCtxt.getId()));
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",partitionId,clusterId,lbClusterId));
    }
  }
 catch (  TerminationException e) {
    log.error(e);
  }
catch (  SpawningException e) {
    log.error(e);
  }
}

Fixed version (ground truth):
private void handleMemberFaultEvent(String clusterId,String memberId){
  try {
    AutoscalerContext asCtx=AutoscalerContext.getInstance();
    AbstractMonitor monitor;
    if (asCtx.moniterExist(clusterId)) {
      monitor=asCtx.getMonitor(clusterId);
    }
 else     if (asCtx.lbMoniterExist(clusterId)) {
      monitor=asCtx.getLBMonitor(clusterId);
    }
 else {
      if (log.isDebugEnabled()) {
        log.debug(String.format("String_Node_Str",clusterId));
      }
      return;
    }
    NetworkPartitionContext nwPartitionCtxt;
    try {
      TopologyManager.acquireReadLock();
      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;
      }
      nwPartitionCtxt=monitor.getNetworkPartitionCtxt(member);
    }
  finally {
      TopologyManager.releaseReadLock();
    }
    String partitionId=monitor.getPartitionOfMember(memberId);
    Partition partition=monitor.getDeploymentPolicy().getPartitionById(partitionId);
    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);
    String lbClusterId=AutoscalerRuleEvaluator.getLbClusterId(partitionCtxt,nwPartitionCtxt);
    partitionCtxt.addPendingMember(ccClient.spawnAnInstance(partition,clusterId,lbClusterId,nwPartitionCtxt.getId()));
    if (log.isInfoEnabled()) {
      log.info(String.format("String_Node_Str",memberId,partitionId,clusterId,lbClusterId));
    }
  }
 catch (  TerminationException e) {
    log.error(e);
  }
catch (  SpawningException e) {
    log.error(e);
  }
}