Program: 38997
Project: 38997
Buggy source:
@Override public void handleRequestBody(SolrQueryRequest req,SolrQueryResponse rsp) throws Exception {
  SolrIndexSearcher searcher=req.getSearcher();
  SchemaField uniqueKeyField=searcher.getSchema().getUniqueKeyField();
  ModifiableSolrParams params=new ModifiableSolrParams(req.getParams());
  configureSolrParameters(req,params,uniqueKeyField.getName());
  ReturnFields returnFields=new SolrReturnFields(req);
  rsp.setReturnFields(returnFields);
  int flags=0;
  if (returnFields.wantsScore()) {
    flags|=SolrIndexSearcher.GET_SCORES;
  }
  String defType=params.get(QueryParsing.DEFTYPE,QParserPlugin.DEFAULT_QTYPE);
  int maxDocumentsToMatch=params.getInt(UnsupervisedFeedbackParams.MAX_DOCUMENTS_TO_PROCESS,DEFAULT_MAX_NUM_DOCUMENTS_TO_PROCESS);
  String q=params.get(CommonParams.Q);
  Query query=null;
  SortSpec sortSpec=null;
  QParser parser=null;
  List<Query> targetFqFilters=null;
  List<Query> ufFqFilters=null;
  try {
    parser=QParser.getParser(q,defType,req);
    query=parser.getQuery();
    sortSpec=parser.getSort(true);
    targetFqFilters=getFilters(req,CommonParams.FQ);
    ufFqFilters=getFilters(req,UnsupervisedFeedbackParams.FQ);
  }
 catch (  SyntaxError e) {
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,e);
  }
  UnsupervisedFeedbackHelper usfdbkHelper=new UnsupervisedFeedbackHelper(params,searcher,uniqueKeyField,parser);
  UnsupervisedFeedbackParams.TermStyle termStyle=UnsupervisedFeedbackParams.TermStyle.get(params.get(UnsupervisedFeedbackParams.INTERESTING_TERMS));
  List<InterestingTerm> interesting=(termStyle == UnsupervisedFeedbackParams.TermStyle.NONE) ? null : new ArrayList<InterestingTerm>(usfdbkHelper.relevancyFeedback.getMaxQueryTermsPerField());
  RFResult usfdbkResult=null;
  Reader reader=null;
  try {
    int start=params.getInt(CommonParams.START,0);
    int rows=params.getInt(CommonParams.ROWS,10);
    if (q == null) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,"String_Node_Str");
    }
 else {
      usfdbkResult=expandQueryAndReExecute(rsp,params,maxDocumentsToMatch,flags,q,query,sortSpec,targetFqFilters,ufFqFilters,searcher,usfdbkHelper,start,rows);
    }
  }
  finally {
    if (reader != null) {
      reader.close();
    }
  }
  DocListAndSet results=new DocListAndSet();
  if (usfdbkResult != null) {
    results=usfdbkResult.getResults();
  }
  rsp.add("String_Node_Str",results);
  if (usfdbkResult != null && termStyle != UnsupervisedFeedbackParams.TermStyle.NONE) {
    addInterestingTerms(rsp,termStyle,usfdbkResult);
  }
  if (params.getBool(FacetParams.FACET,false)) {
    addFacet(req,rsp,params,results);
  }
  addDebugInfo(req,rsp,q,ufFqFilters,usfdbkResult);
}

Fixed version (ground truth):
@Override public void handleRequestBody(SolrQueryRequest req,SolrQueryResponse rsp) throws Exception {
  SolrIndexSearcher searcher=req.getSearcher();
  SchemaField uniqueKeyField=searcher.getSchema().getUniqueKeyField();
  ModifiableSolrParams params=new ModifiableSolrParams(req.getParams());
  configureSolrParameters(req,params,uniqueKeyField.getName());
  ReturnFields returnFields=new SolrReturnFields(req);
  rsp.setReturnFields(returnFields);
  int flags=0;
  if (returnFields.wantsScore()) {
    flags|=SolrIndexSearcher.GET_SCORES;
  }
  String defType=params.get(QueryParsing.DEFTYPE,QParserPlugin.DEFAULT_QTYPE);
  int maxDocumentsToMatch=params.getInt(UnsupervisedFeedbackParams.MAX_DOCUMENTS_TO_PROCESS,DEFAULT_MAX_NUM_DOCUMENTS_TO_PROCESS);
  String q=params.get(CommonParams.Q);
  Query query=null;
  SortSpec sortSpec=null;
  QParser parser=null;
  List<Query> targetFqFilters=null;
  List<Query> ufFqFilters=null;
  try {
    parser=QParser.getParser(q,defType,req);
    query=parser.getQuery();
    sortSpec=parser.getSort(true);
    targetFqFilters=getFilters(req,CommonParams.FQ);
    ufFqFilters=getFilters(req,UnsupervisedFeedbackParams.FQ);
  }
 catch (  SyntaxError e) {
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,e);
  }
  UnsupervisedFeedbackHelper usfdbkHelper=new UnsupervisedFeedbackHelper(params,searcher,uniqueKeyField,parser);
  UnsupervisedFeedbackParams.TermStyle termStyle=UnsupervisedFeedbackParams.TermStyle.get(params.get(UnsupervisedFeedbackParams.INTERESTING_TERMS));
  List<InterestingTerm> interesting=(termStyle == UnsupervisedFeedbackParams.TermStyle.NONE) ? null : new ArrayList<InterestingTerm>(usfdbkHelper.relevancyFeedback.getMaxQueryTermsPerField());
  RFResult usfdbkResult=null;
  Reader reader=null;
  try {
    int start=params.getInt(CommonParams.START,0);
    int rows=params.getInt(CommonParams.ROWS,10);
    if (q == null) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,"String_Node_Str");
    }
 else {
      usfdbkResult=expandQueryAndReExecute(rsp,params,maxDocumentsToMatch,flags,q,query,sortSpec,targetFqFilters,ufFqFilters,searcher,usfdbkHelper,start,rows);
    }
  }
  finally {
    if (reader != null) {
      reader.close();
    }
  }
  DocListAndSet results=new DocListAndSet();
  if (usfdbkResult != null) {
    results=usfdbkResult.getResults();
  }
  rsp.add("String_Node_Str",results.docList);
  if (usfdbkResult != null && termStyle != UnsupervisedFeedbackParams.TermStyle.NONE) {
    addInterestingTerms(rsp,termStyle,usfdbkResult);
  }
  if (params.getBool(FacetParams.FACET,false)) {
    addFacet(req,rsp,params,results);
  }
  addDebugInfo(req,rsp,q,ufFqFilters,usfdbkResult);
}