Program: 12368
Project: 12368
Buggy source:
@Override public List<JATETerm> extract(SolrCore core,String jatePropertyFile) throws IOException, JATEException {
  SolrIndexSearcher searcher=core.getSearcher().get();
  try {
    JATEProperties properties=new JATEProperties(jatePropertyFile);
    FrequencyTermBasedFBMaster ftbb=new FrequencyTermBasedFBMaster(searcher,properties,0);
    FrequencyTermBased ftb=(FrequencyTermBased)ftbb.build();
    FrequencyCtxWindowBasedFBMaster fcsbb=new FrequencyCtxWindowBasedFBMaster(searcher,properties,null,5,0);
    FrequencyCtxBased fcsb=(FrequencyCtxBased)fcsbb.build();
    FrequencyCtxBased ref_fcsb=(FrequencyCtxBased)(new FrequencyCtxWindowBasedFBMaster(searcher,properties,fcsb.getMapCtx2TTF().keySet(),5,0).build());
    CooccurrenceFBMaster cb=new CooccurrenceFBMaster(searcher,properties,ftb,this.prefilterMinTTF,fcsb,ref_fcsb,this.prefilterMinTCF);
    Cooccurrence co=(Cooccurrence)cb.build();
    ChiSquare chi=new ChiSquare();
    chi.registerFeature(FrequencyTermBased.class.getName(),ftb);
    chi.registerFeature(FrequencyCtxBased.class.getName() + ChiSquare.SUFFIX_TERM,fcsb);
    chi.registerFeature(FrequencyCtxBased.class.getName() + ChiSquare.SUFFIX_REF_TERM,ref_fcsb);
    chi.registerFeature(Cooccurrence.class.getName(),co);
    List<JATETerm> terms=chi.execute(co.getTerms());
    terms=cutoff(terms);
    addAdditionalTermInfo(terms,searcher,properties.getSolrFieldnameJATENGramInfo(),properties.getSolrFieldnameID());
    return terms;
  }
  finally {
    searcher.close();
  }
}

Fixed version (ground truth):
@Override public List<JATETerm> extract(SolrCore core,String jatePropertyFile) throws IOException, JATEException {
  SolrIndexSearcher searcher=core.getSearcher().get();
  try {
    JATEProperties properties=new JATEProperties(jatePropertyFile);
    FrequencyTermBasedFBMaster ftbb=new FrequencyTermBasedFBMaster(searcher,properties,0);
    FrequencyTermBased ftb=(FrequencyTermBased)ftbb.build();
    FrequencyCtxWindowBasedFBMaster fcsbb=new FrequencyCtxWindowBasedFBMaster(searcher,properties,null,5,0);
    FrequencyCtxBased fcsb=(FrequencyCtxBased)fcsbb.build();
    FrequencyCtxBased ref_fcsb=(FrequencyCtxBased)(new FrequencyCtxWindowBasedFBMaster(searcher,properties,fcsb.getMapCtx2TTF().keySet(),5,0).build());
    List<String> inter=new ArrayList<>(fcsb.getCtxOverlapZones().keySet());
    inter.removeAll(ref_fcsb.getCtxOverlapZones().keySet());
    Collections.sort(inter);
    CooccurrenceFBMaster cb=new CooccurrenceFBMaster(searcher,properties,ftb,this.prefilterMinTTF,fcsb,ref_fcsb,this.prefilterMinTCF);
    Cooccurrence co=(Cooccurrence)cb.build();
    ChiSquare chi=new ChiSquare();
    chi.registerFeature(FrequencyTermBased.class.getName(),ftb);
    chi.registerFeature(FrequencyCtxBased.class.getName() + ChiSquare.SUFFIX_TERM,fcsb);
    chi.registerFeature(FrequencyCtxBased.class.getName() + ChiSquare.SUFFIX_REF_TERM,ref_fcsb);
    chi.registerFeature(Cooccurrence.class.getName(),co);
    List<JATETerm> terms=chi.execute(co.getTerms());
    terms=cutoff(terms);
    addAdditionalTermInfo(terms,searcher,properties.getSolrFieldnameJATENGramInfo(),properties.getSolrFieldnameID());
    return terms;
  }
  finally {
    searcher.close();
  }
}