Program: 12290
Project: 12290
Buggy source:
/** 
 * Index weighted & filtered final terms back into Solr
 * @param filteredTerms   filtered JATE terms
 * @param jateProperties  jate properties for integration config between jate2.0 and solr instance
 * @param indexSearcher   solr index searcher
 * @param isBoosted       true or false to indivate whether term will be boosted with ATE score
 * @throws JATEException
 */
public void indexTerms(List<JATETerm> filteredTerms,JATEProperties jateProperties,SolrIndexSearcher indexSearcher,boolean isBoosted,boolean isExtraction) throws JATEException {
  int numDocs=indexSearcher.maxDoc();
  String domainTermsFieldName=jateProperties.getSolrFieldNameJATEDomainTerms();
  String candidateTermFieldName=jateProperties.getSolrFieldNameJATECTerms();
  log.info(String.format("String_Node_Str",filteredTerms.size(),domainTermsFieldName,numDocs));
  if (filteredTerms.size() == 0) {
    return;
  }
  SolrCore core=indexSearcher.getCore();
  IndexSchema indexSchema=core.getLatestSchema();
  try {
    IndexWriter writerIn=core.getSolrCoreState().getIndexWriter(core).get();
    Map<String,List<CopyField>> copyFields=indexSchema.getCopyFieldsMap();
    for (int docID=0; docID < numDocs; docID++) {
      try {
        Document doc=indexSearcher.doc(docID);
        if (isExtraction) {
          SolrUtil.copyFields(copyFields,DEFAULT_BOOST_VALUE,doc);
        }
        Terms indexedCandidateTermsVectors=SolrUtil.getTermVector(docID,candidateTermFieldName,indexSearcher);
        List<String> candidateTerms=SolrUtil.getNormalisedTerms(indexedCandidateTermsVectors);
        List<Pair<String,Double>> filteredCandidateTerms=getSelectedWeightedCandidates(filteredTerms,candidateTerms);
        iterateAddDomainTermFields(isBoosted,domainTermsFieldName,indexSchema,doc,filteredCandidateTerms);
        writerIn.updateDocument(new Term("String_Node_Str",doc.get("String_Node_Str")),doc);
      }
 catch (      IOException e) {
        throw new JATEException(String.format("String_Node_Str" + "String_Node_Str",docID,e.toString()));
      }
    }
  }
 catch (  IOException ioe) {
    throw new JATEException(String.format("String_Node_Str" + "String_Node_Str",ioe.toString()));
  }
  log.info(String.format("String_Node_Str",domainTermsFieldName));
}

Fixed version (ground truth):
/** 
 * Index weighted & filtered final terms back into Solr
 * @param filteredTerms   filtered JATE terms
 * @param jateProperties  jate properties for integration config between jate2.0 and solr instance
 * @param indexSearcher   solr index searcher
 * @param isBoosted       true or false to indicate whether term will be boosted with ATE score
 * @throws JATEException
 */
public void indexTerms(List<JATETerm> filteredTerms,JATEProperties jateProperties,SolrIndexSearcher indexSearcher,boolean isBoosted,boolean isExtraction) throws JATEException {
  int numDocs=indexSearcher.maxDoc();
  String domainTermsFieldName=jateProperties.getSolrFieldNameJATEDomainTerms();
  String candidateTermFieldName=jateProperties.getSolrFieldNameJATECTerms();
  log.info(String.format("String_Node_Str",filteredTerms.size(),domainTermsFieldName,numDocs));
  if (filteredTerms.size() == 0) {
    return;
  }
  SolrCore core=indexSearcher.getCore();
  IndexSchema indexSchema=core.getLatestSchema();
  IndexWriter writerIn=null;
  try {
    writerIn=core.getSolrCoreState().getIndexWriter(core).get();
    Map<String,List<CopyField>> copyFields=indexSchema.getCopyFieldsMap();
    for (int docID=0; docID < numDocs; docID++) {
      try {
        Document doc=indexSearcher.doc(docID);
        if (isExtraction) {
          SolrUtil.copyFields(copyFields,DEFAULT_BOOST_VALUE,doc);
        }
        Terms indexedCandidateTermsVectors=SolrUtil.getTermVector(docID,candidateTermFieldName,indexSearcher);
        if (indexedCandidateTermsVectors == null) {
          continue;
        }
        List<String> candidateTerms=SolrUtil.getNormalisedTerms(indexedCandidateTermsVectors);
        List<Pair<String,Double>> filteredCandidateTerms=getSelectedWeightedCandidates(filteredTerms,candidateTerms);
        iterateAddDomainTermFields(isBoosted,domainTermsFieldName,indexSchema,doc,filteredCandidateTerms);
        log.debug(String.format("String_Node_Str",doc.get("String_Node_Str"),doc.get("String_Node_Str")));
        String currentVersionNo=doc.get("String_Node_Str");
        doc.removeField("String_Node_Str");
        doc.add(indexSchema.getField("String_Node_Str").createField(versionIncrement(currentVersionNo),DEFAULT_BOOST_VALUE));
        writerIn.updateDocument(new Term("String_Node_Str",doc.get("String_Node_Str")),doc);
      }
 catch (      IOException e) {
        throw new JATEException(String.format("String_Node_Str" + "String_Node_Str",docID,e.toString()));
      }
    }
    writerIn.forceMerge(1,false);
    writerIn.commit();
  }
 catch (  IOException ioe) {
    throw new JATEException(String.format("String_Node_Str" + "String_Node_Str",ioe.toString()));
  }
  log.info(String.format("String_Node_Str",domainTermsFieldName));
}