Program: 116269
Project: 116269
Buggy source:
public void monitor(){
  Set<Map.Entry<String,AbstractClusterContext>> instanceIdToClusterCtxtEntries=instanceIdToClusterContextMap.entrySet();
  for (  final Map.Entry<String,AbstractClusterContext> instanceIdToClusterCtxtEntry : instanceIdToClusterCtxtEntries) {
    Runnable monitoringRunnable=new Runnable(){
      @Override public void run(){
        for (        NetworkPartitionContext networkPartitionContext : getNetworkPartitionCtxts(instanceIdToClusterCtxtEntry.getKey()).values()) {
          List<String> primaryMemberListInNetworkPartition=new ArrayList<String>();
          for (          PartitionContext partitionContext : networkPartitionContext.getPartitionCtxts().values()) {
            List<String> primaryMemberListInPartition=new ArrayList<String>();
            for (            MemberContext memberContext : partitionContext.getActiveMembers()) {
              if (isPrimaryMember(memberContext)) {
                primaryMemberListInPartition.add(memberContext.getMemberId());
              }
            }
            for (            MemberContext memberContext : partitionContext.getPendingMembers()) {
              if (isPrimaryMember(memberContext)) {
                primaryMemberListInPartition.add(memberContext.getMemberId());
              }
            }
            primaryMemberListInNetworkPartition.addAll(primaryMemberListInPartition);
            getMinCheckKnowledgeSession().setGlobal("String_Node_Str",getClusterId());
            getMinCheckKnowledgeSession().setGlobal("String_Node_Str",lbReferenceType);
            getMinCheckKnowledgeSession().setGlobal("String_Node_Str",hasPrimary);
            getMinCheckKnowledgeSession().setGlobal("String_Node_Str","String_Node_Str");
            if (log.isDebugEnabled()) {
              log.debug(String.format("String_Node_Str",partitionContext.getPartitionId()));
            }
            minCheckFactHandle=AutoscalerRuleEvaluator.evaluateMinCheck(getMinCheckKnowledgeSession(),minCheckFactHandle,partitionContext);
            obsoleteCheckFactHandle=AutoscalerRuleEvaluator.evaluateObsoleteCheck(getObsoleteCheckKnowledgeSession(),obsoleteCheckFactHandle,partitionContext);
          }
          boolean rifReset=networkPartitionContext.isRifReset();
          boolean memoryConsumptionReset=networkPartitionContext.isMemoryConsumptionReset();
          boolean loadAverageReset=networkPartitionContext.isLoadAverageReset();
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + rifReset + "String_Node_Str"+ memoryConsumptionReset+ "String_Node_Str"+ loadAverageReset);
          }
          if (rifReset || memoryConsumptionReset || loadAverageReset) {
            VMClusterContext vmClusterContext=(VMClusterContext)instanceIdToClusterCtxtEntry.getValue();
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str","String_Node_Str");
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",getClusterId());
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",vmClusterContext.getAutoscalePolicy());
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",rifReset);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",memoryConsumptionReset);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",loadAverageReset);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",lbReferenceType);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",false);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",primaryMemberListInNetworkPartition);
            if (log.isDebugEnabled()) {
              log.debug(String.format("String_Node_Str",networkPartitionContext.getId()));
              log.debug("String_Node_Str" + primaryMemberListInNetworkPartition);
            }
            scaleCheckFactHandle=AutoscalerRuleEvaluator.evaluateScaleCheck(getScaleCheckKnowledgeSession(),scaleCheckFactHandle,networkPartitionContext);
            networkPartitionContext.setRifReset(false);
            networkPartitionContext.setMemoryConsumptionReset(false);
            networkPartitionContext.setLoadAverageReset(false);
          }
 else           if (log.isDebugEnabled()) {
            log.debug(String.format("String_Node_Str" + "String_Node_Str",networkPartitionContext.getId()));
          }
        }
      }
    }
;
    monitoringRunnable.run();
  }
}

Fixed version (ground truth):
public void monitor(){
  Set<Map.Entry<String,AbstractClusterContext>> instanceIdToClusterCtxtEntries=instanceIdToClusterContextMap.entrySet();
  for (  final Map.Entry<String,AbstractClusterContext> instanceIdToClusterCtxtEntry : instanceIdToClusterCtxtEntries) {
    Runnable monitoringRunnable=new Runnable(){
      @Override public void run(){
        for (        NetworkPartitionContext networkPartitionContext : getNetworkPartitionCtxts(instanceIdToClusterCtxtEntry.getKey()).values()) {
          List<String> primaryMemberListInNetworkPartition=new ArrayList<String>();
          for (          PartitionContext partitionContext : networkPartitionContext.getPartitionCtxts().values()) {
            List<String> primaryMemberListInPartition=new ArrayList<String>();
            for (            MemberContext memberContext : partitionContext.getActiveMembers()) {
              if (isPrimaryMember(memberContext)) {
                primaryMemberListInPartition.add(memberContext.getMemberId());
              }
            }
            for (            MemberContext memberContext : partitionContext.getPendingMembers()) {
              if (isPrimaryMember(memberContext)) {
                primaryMemberListInPartition.add(memberContext.getMemberId());
              }
            }
            primaryMemberListInNetworkPartition.addAll(primaryMemberListInPartition);
            getMinCheckKnowledgeSession().setGlobal("String_Node_Str",getClusterId());
            getMinCheckKnowledgeSession().setGlobal("String_Node_Str",lbReferenceType);
            getMinCheckKnowledgeSession().setGlobal("String_Node_Str",hasPrimary);
            getMinCheckKnowledgeSession().setGlobal("String_Node_Str",instanceIdToClusterCtxtEntry.getKey());
            if (log.isDebugEnabled()) {
              log.debug(String.format("String_Node_Str",partitionContext.getPartitionId()));
            }
            minCheckFactHandle=AutoscalerRuleEvaluator.evaluateMinCheck(getMinCheckKnowledgeSession(),minCheckFactHandle,partitionContext);
            obsoleteCheckFactHandle=AutoscalerRuleEvaluator.evaluateObsoleteCheck(getObsoleteCheckKnowledgeSession(),obsoleteCheckFactHandle,partitionContext);
          }
          boolean rifReset=networkPartitionContext.isRifReset();
          boolean memoryConsumptionReset=networkPartitionContext.isMemoryConsumptionReset();
          boolean loadAverageReset=networkPartitionContext.isLoadAverageReset();
          if (log.isDebugEnabled()) {
            log.debug("String_Node_Str" + rifReset + "String_Node_Str"+ memoryConsumptionReset+ "String_Node_Str"+ loadAverageReset);
          }
          if (rifReset || memoryConsumptionReset || loadAverageReset) {
            VMClusterContext vmClusterContext=(VMClusterContext)instanceIdToClusterCtxtEntry.getValue();
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",instanceIdToClusterCtxtEntry.getKey());
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",getClusterId());
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",vmClusterContext.getAutoscalePolicy());
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",rifReset);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",memoryConsumptionReset);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",loadAverageReset);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",lbReferenceType);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",false);
            getScaleCheckKnowledgeSession().setGlobal("String_Node_Str",primaryMemberListInNetworkPartition);
            if (log.isDebugEnabled()) {
              log.debug(String.format("String_Node_Str",networkPartitionContext.getId()));
              log.debug("String_Node_Str" + primaryMemberListInNetworkPartition);
            }
            scaleCheckFactHandle=AutoscalerRuleEvaluator.evaluateScaleCheck(getScaleCheckKnowledgeSession(),scaleCheckFactHandle,networkPartitionContext);
            networkPartitionContext.setRifReset(false);
            networkPartitionContext.setMemoryConsumptionReset(false);
            networkPartitionContext.setLoadAverageReset(false);
          }
 else           if (log.isDebugEnabled()) {
            log.debug(String.format("String_Node_Str" + "String_Node_Str",networkPartitionContext.getId()));
          }
        }
      }
    }
;
    monitoringRunnable.run();
  }
}