Program: 17979
Project: 17979
Buggy source:
@Override public void process(ResponseBuilder rb) throws IOException {
  if (activated) {
    SolrParams params=rb.req.getParams();
    Integer original_limit=params.getInt("String_Node_Str",params.getInt("String_Node_Str"));
    SolrQueryRequest req=rb.req;
    SolrQueryResponse rsp=rb.rsp;
    DocListAndSet results=rb.getResults();
    DocList dl=results.docList;
    if (dl.size() < 1) {
      return;
    }
    int[] recids=new int[dl.size()];
    DocIterator it=dl.iterator();
    AtomicReader reader=rb.req.getSearcher().getAtomicReader();
    int[] docidMap=FieldCache.DEFAULT.getInts(reader,getIdField(rb.req),false);
    for (int i=0; it.hasNext(); i++) {
      recids[i]=docidMap[it.next()];
    }
    PythonMessage message=MontySolrVM.INSTANCE.createMessage("String_Node_Str").setSender("String_Node_Str").setParam("String_Node_Str",req).setParam("String_Node_Str",rsp).setParam("String_Node_Str",recids).setParam("String_Node_Str",invParams);
    MontySolrVM.INSTANCE.sendMessage(message);
    Object result=message.getResults();
    String t=(String)message.getParam("String_Node_Str");
    if (result != null && t.contains("String_Node_Str")) {
      rb.rsp.add("String_Node_Str",(String)result);
      int[] luceneIds=new int[original_limit > dl.size() ? dl.size() : original_limit];
      it=dl.iterator();
      for (int i=0; i < luceneIds.length && it.hasNext(); i++) {
        luceneIds[i]=it.next();
      }
      DocListAndSet res=new DocListAndSet();
      res.docList=new DocSlice(results.docList.offset(),luceneIds.length,luceneIds,null,dl.matches(),results.docList.maxScore());
      rb.setResults(res);
      NamedList vals=rsp.getValues();
      vals.remove("String_Node_Str");
      rsp.add("String_Node_Str",rb.getResults().docList);
    }
 else {
      Map<Integer,Integer> recidToDocid=DictionaryRecIdCache.INSTANCE.getTranslationCache(reader,new String[]{rb.req.getSchema().getUniqueKeyField().getName()});
      int[] recs=(int[])result;
      int[] luceneIds=new int[original_limit > recs.length ? recs.length : original_limit];
      for (int i=0; i < luceneIds.length; i++) {
        luceneIds[i]=recidToDocid.get(recs[i]);
      }
      DocListAndSet res=new DocListAndSet();
      res.docList=new DocSlice(results.docList.offset(),luceneIds.length,luceneIds,null,dl.matches(),results.docList.maxScore());
      rb.setResults(res);
      NamedList vals=rsp.getValues();
      vals.remove("String_Node_Str");
      rsp.add("String_Node_Str",rb.getResults().docList);
    }
  }
  rb.rsp.add("String_Node_Str",rb.getQuery().toString());
}

Fixed version (ground truth):
@Override public void process(ResponseBuilder rb) throws IOException {
  if (activated) {
    SolrParams params=rb.req.getParams();
    Integer original_limit=params.getInt("String_Node_Str",params.getInt("String_Node_Str"));
    SolrQueryRequest req=rb.req;
    SolrQueryResponse rsp=rb.rsp;
    DocListAndSet results=rb.getResults();
    DocList dl=results.docList;
    if (dl.size() < 1) {
      return;
    }
    int[] recids=new int[dl.size()];
    DocIterator it=dl.iterator();
    AtomicReader reader=rb.req.getSearcher().getAtomicReader();
    int[] docidMap=FieldCache.DEFAULT.getInts(reader,getIdField(rb.req),false);
    for (int i=0; it.hasNext(); i++) {
      recids[i]=docidMap[it.next()];
    }
    PythonMessage message=MontySolrVM.INSTANCE.createMessage("String_Node_Str").setSender("String_Node_Str").setParam("String_Node_Str",req).setParam("String_Node_Str",rsp).setParam("String_Node_Str",recids).setParam("String_Node_Str",invParams);
    MontySolrVM.INSTANCE.sendMessage(message);
    Object result=message.getResults();
    String t=(String)message.getParam("String_Node_Str");
    if (result != null && t.contains("String_Node_Str")) {
      rb.rsp.add("String_Node_Str",(String)result);
      int[] luceneIds=new int[original_limit > dl.size() ? dl.size() : original_limit];
      it=dl.iterator();
      for (int i=0; i < luceneIds.length && it.hasNext(); i++) {
        luceneIds[i]=it.next();
      }
      DocListAndSet res=new DocListAndSet();
      res.docList=new DocSlice(results.docList.offset(),luceneIds.length,luceneIds,null,dl.matches(),results.docList.maxScore());
      rb.setResults(res);
      NamedList vals=rsp.getValues();
      vals.remove("String_Node_Str");
      rsp.add("String_Node_Str",rb.getResults().docList);
    }
 else {
      Map<Integer,Integer> recidToDocid=DictionaryRecIdCache.INSTANCE.getCache(DictionaryRecIdCache.Int2LuceneId.MAPPING,rb.req.getSearcher(),new String[]{rb.req.getSchema().getUniqueKeyField().getName()});
      int[] recs=(int[])result;
      int[] luceneIds=new int[original_limit > recs.length ? recs.length : original_limit];
      for (int i=0; i < luceneIds.length; i++) {
        luceneIds[i]=recidToDocid.get(recs[i]);
      }
      DocListAndSet res=new DocListAndSet();
      res.docList=new DocSlice(results.docList.offset(),luceneIds.length,luceneIds,null,dl.matches(),results.docList.maxScore());
      rb.setResults(res);
      NamedList vals=rsp.getValues();
      vals.remove("String_Node_Str");
      rsp.add("String_Node_Str",rb.getResults().docList);
    }
  }
  rb.rsp.add("String_Node_Str",rb.getQuery().toString());
}