Program: 17964
Project: 17964
Buggy source:
private BitSet[] discoverMissingRecords(BitSet present,BitSet missing,BitSet toDelete,SolrQueryRequest req) throws IOException {
  SolrQueryResponse rsp=new SolrQueryResponse();
  HashMap<String,int[]> dictData=null;
  SolrParams params=req.getParams();
  String field=params.get("String_Node_Str","String_Node_Str");
  Integer lastRecid=params.getInt("String_Node_Str",-1);
  String modDate=params.get("String_Node_Str",null);
  Boolean forceReindexing=params.getBool("String_Node_Str");
  Integer fetchSize=Math.min(params.getInt("String_Node_Str",100000),100000);
  int maxRecs=Math.min(params.getInt("String_Node_Str",100000),1000000);
  int[] existingRecs=FieldCache.DEFAULT.getInts(req.getSearcher().getAtomicReader(),field,false);
  Map<Integer,Integer> idToLuceneId;
  if (tmpMap.containsKey(existingRecs.hashCode())) {
    idToLuceneId=tmpMap.get(existingRecs.hashCode());
  }
 else {
    tmpMap.clear();
    idToLuceneId=new HashMap<Integer,Integer>(existingRecs.length);
    for (int i=0; i < existingRecs.length; i++) {
      idToLuceneId.put(existingRecs[i],i);
    }
  }
  if (present == null)   present=new BitSet(existingRecs.length);
  if (missing == null)   missing=new BitSet(existingRecs.length);
  int doneSoFar=0;
  boolean finished=false;
  log.info("String_Node_Str",lastRecid);
  while (doneSoFar < maxRecs) {
    PythonMessage message=MontySolrVM.INSTANCE.createMessage(pythonFunctionName).setSender("String_Node_Str").setParam("String_Node_Str",fetchSize).setParam("String_Node_Str",req).setParam("String_Node_Str",rsp).setParam("String_Node_Str",modDate).setParam("String_Node_Str",lastRecid);
    MontySolrVM.INSTANCE.sendMessage(message);
    Object results=message.getResults();
    if (results == null) {
      finished=true;
      tmpMap.clear();
      break;
    }
    dictData=(HashMap<String,int[]>)results;
    for (    String name : new String[]{"String_Node_Str","String_Node_Str"}) {
      int[] coll=dictData.get(name);
      doneSoFar+=coll.length;
      for (      int x : coll) {
        if (!forceReindexing && idToLuceneId.containsKey(x)) {
          present.set(x);
        }
 else {
          missing.set(x);
        }
      }
    }
    int[] deleted=dictData.get("String_Node_Str");
    doneSoFar+=deleted.length;
    for (    int x : deleted) {
      if (idToLuceneId.containsKey(x)) {
        toDelete.set(x);
      }
    }
    lastRecid=(Integer)message.getParam("String_Node_Str");
    modDate=(String)message.getParam("String_Node_Str");
    log.info("String_Node_Str",lastRecid,doneSoFar);
  }
  if (!finished) {
    ModifiableSolrParams mp=new ModifiableSolrParams(params);
    mp.set("String_Node_Str",lastRecid);
    mp.set("String_Node_Str",modDate);
    mp.remove("String_Node_Str");
    queue.registerNewBatch("String_Node_Str",mp.toString());
  }
 else {
    queue.registerNewBatch("String_Node_Str","String_Node_Str");
  }
  return new BitSet[]{present,missing,toDelete};
}

Fixed version (ground truth):
private BitSet[] discoverMissingRecords(BitSet present,BitSet missing,BitSet toDelete,SolrQueryRequest req) throws IOException {
  SolrQueryResponse rsp=new SolrQueryResponse();
  HashMap<String,int[]> dictData=null;
  SolrParams params=req.getParams();
  String field=params.get("String_Node_Str","String_Node_Str");
  Integer lastRecid=params.getInt("String_Node_Str",-1);
  String modDate=params.get("String_Node_Str",null);
  Boolean forceReindexing=params.getBool("String_Node_Str",false);
  Integer fetchSize=Math.min(params.getInt("String_Node_Str",100000),100000);
  int maxRecs=Math.min(params.getInt("String_Node_Str",100000),1000000);
  int[] existingRecs=FieldCache.DEFAULT.getInts(req.getSearcher().getAtomicReader(),field,false);
  Map<Integer,Integer> idToLuceneId;
  if (tmpMap.containsKey(existingRecs.hashCode())) {
    idToLuceneId=tmpMap.get(existingRecs.hashCode());
  }
 else {
    tmpMap.clear();
    idToLuceneId=new HashMap<Integer,Integer>(existingRecs.length);
    for (int i=0; i < existingRecs.length; i++) {
      idToLuceneId.put(existingRecs[i],i);
    }
  }
  if (present == null)   present=new BitSet(existingRecs.length);
  if (missing == null)   missing=new BitSet(existingRecs.length);
  int doneSoFar=0;
  boolean finished=false;
  log.info("String_Node_Str",lastRecid);
  while (doneSoFar < maxRecs) {
    PythonMessage message=MontySolrVM.INSTANCE.createMessage(pythonFunctionName).setSender("String_Node_Str").setParam("String_Node_Str",fetchSize).setParam("String_Node_Str",req).setParam("String_Node_Str",rsp).setParam("String_Node_Str",modDate).setParam("String_Node_Str",lastRecid);
    MontySolrVM.INSTANCE.sendMessage(message);
    Object results=message.getResults();
    if (results == null) {
      finished=true;
      tmpMap.clear();
      break;
    }
    dictData=(HashMap<String,int[]>)results;
    for (    String name : new String[]{"String_Node_Str","String_Node_Str"}) {
      int[] coll=dictData.get(name);
      doneSoFar+=coll.length;
      for (      int x : coll) {
        if (!forceReindexing && idToLuceneId.containsKey(x)) {
          present.set(x);
        }
 else {
          missing.set(x);
        }
      }
    }
    int[] deleted=dictData.get("String_Node_Str");
    doneSoFar+=deleted.length;
    for (    int x : deleted) {
      if (idToLuceneId.containsKey(x)) {
        toDelete.set(x);
      }
    }
    lastRecid=(Integer)message.getParam("String_Node_Str");
    modDate=(String)message.getParam("String_Node_Str");
    log.info("String_Node_Str",lastRecid,doneSoFar);
  }
  if (!finished) {
    ModifiableSolrParams mp=new ModifiableSolrParams(params);
    mp.set("String_Node_Str",lastRecid);
    mp.set("String_Node_Str",modDate);
    mp.remove("String_Node_Str");
    queue.registerNewBatch("String_Node_Str",mp.toString());
  }
 else {
    queue.registerNewBatch("String_Node_Str","String_Node_Str");
  }
  return new BitSet[]{present,missing,toDelete};
}