Program: 115583
Project: 115583
Buggy source:
public void terminatePendingMembers(final String instanceId,final String networkPartitionId){
  final ClusterMonitor monitor=this;
  Thread memberTerminator=new Thread(new Runnable(){
    public void run(){
      ClusterInstanceContext instanceContext=(ClusterInstanceContext)getAllNetworkPartitionCtxts().get(networkPartitionId).getInstanceContext(instanceId);
      boolean allMovedToObsolete=true;
      for (      ClusterLevelPartitionContext partitionContext : instanceContext.getPartitionCtxts()) {
        if (log.isInfoEnabled()) {
          log.info("String_Node_Str" + getClusterId() + "String_Node_Str"+ "String_Node_Str"+ instanceContext.getNetworkPartitionId()+ "String_Node_Str"+ partitionContext.getPartitionId()+ "String_Node_Str");
        }
        if (AutoscalerContext.getInstance().getAppMonitor(getAppId()).isForce()) {
          log.info(String.format("String_Node_Str",partitionContext.getPartitionId(),getAppId()));
          partitionContext.terminateAllRemainingInstances();
        }
        Iterator<MemberContext> pendingIterator=partitionContext.getPendingMembers().listIterator();
        List<String> pendingMemberIdList=new ArrayList<String>();
        while (pendingIterator.hasNext()) {
          MemberContext pendingMemberContext=pendingIterator.next();
          pendingMemberIdList.add(pendingMemberContext.getMemberId());
        }
        for (        String memberId : pendingMemberIdList) {
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + memberId + "String_Node_Str");
          }
          partitionContext.movePendingMemberToObsoleteMembers(memberId);
        }
        allMovedToObsolete=partitionContext.getTotalMemberCount() == 0;
      }
      if (allMovedToObsolete) {
        monitor.monitor();
      }
    }
  }
,"String_Node_Str" + getClusterId());
  memberTerminator.start();
}

Fixed version (ground truth):
public void terminatePendingMembers(final String instanceId,final String networkPartitionId){
  final ClusterMonitor monitor=this;
  Thread memberTerminator=new Thread(new Runnable(){
    public void run(){
      NetworkPartitionContext networkPartitionContext=getAllNetworkPartitionCtxts().get(networkPartitionId);
      ClusterInstanceContext instanceContext=(ClusterInstanceContext)networkPartitionContext.getInstanceContext(instanceId);
      if (instanceContext != null) {
        boolean allMovedToObsolete=true;
        for (        ClusterLevelPartitionContext partitionContext : instanceContext.getPartitionCtxts()) {
          if (log.isInfoEnabled()) {
            log.info("String_Node_Str" + getClusterId() + "String_Node_Str"+ "String_Node_Str"+ instanceContext.getNetworkPartitionId()+ "String_Node_Str"+ partitionContext.getPartitionId()+ "String_Node_Str");
          }
          if (AutoscalerContext.getInstance().getAppMonitor(getAppId()).isForce()) {
            log.info(String.format("String_Node_Str",partitionContext.getPartitionId(),getAppId()));
            partitionContext.terminateAllRemainingInstances();
          }
          Iterator<MemberContext> pendingIterator=partitionContext.getPendingMembers().listIterator();
          List<String> pendingMemberIdList=new ArrayList<String>();
          while (pendingIterator.hasNext()) {
            MemberContext pendingMemberContext=pendingIterator.next();
            pendingMemberIdList.add(pendingMemberContext.getMemberId());
          }
          for (          String memberId : pendingMemberIdList) {
            if (log.isDebugEnabled()) {
              log.debug("String_Node_Str" + memberId + "String_Node_Str");
            }
            partitionContext.movePendingMemberToObsoleteMembers(memberId);
          }
          allMovedToObsolete=partitionContext.getTotalMemberCount() == 0;
        }
        if (allMovedToObsolete) {
          monitor.monitor();
        }
      }
    }
  }
,"String_Node_Str" + getClusterId());
  memberTerminator.start();
}