nus-yam/ex-repair huggingface dataset:
Program: 53012
Project: 53012
Buggy source:
/** 
 * Indexes a specific RawPage
 * @param page the page to index
 */
public void indexPage(RawPage page) throws DaoException {
  if (closed) {
    throw new IllegalStateException("String_Node_Str");
  }
  Language language=page.getLanguage();
  if (getLanguageSet().containsLanguage(language)) {
    try {
      Document document=new Document();
      Field localIdField=new IntField(LuceneOptions.LOCAL_ID_FIELD_NAME,page.getLocalId(),Field.Store.YES);
      Field langIdField=new IntField(LuceneOptions.LANG_ID_FIELD_NAME,page.getLanguage().getId(),Field.Store.YES);
      Field canonicalTitleField=builder.buildTextField(page,new TextFieldElements().addTitle());
      document.add(localIdField);
      document.add(langIdField);
      document.add(canonicalTitleField);
      if (!page.isRedirect()) {
        for (        LuceneOptions option : options) {
          document.add(builder.buildTextField(page,option.elements));
        }
      }
      writers.get(language).addDocument(document);
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Indexes a specific RawPage
 * @param page the page to index
 */
public void indexPage(RawPage page) throws DaoException {
  if (closed) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!language.equals(page.getLanguage())) {
    throw new IllegalStateException("String_Node_Str");
  }
  try {
    Document document=new Document();
    Field localIdField=new IntField(LuceneOptions.LOCAL_ID_FIELD_NAME,page.getLocalId(),Field.Store.YES);
    Field langIdField=new IntField(LuceneOptions.LANG_ID_FIELD_NAME,page.getLanguage().getId(),Field.Store.YES);
    Field canonicalTitleField=builder.buildTextField(page,new TextFieldElements().addTitle());
    document.add(localIdField);
    document.add(langIdField);
    document.add(canonicalTitleField);
    if (!page.isRedirect()) {
      for (      LuceneOptions option : options) {
        document.add(builder.buildTextField(page,option.elements));
      }
    }
    writer.addDocument(document);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 53013
Project: 53013
Buggy source:
/** 
 * Method should be called when done indexing.
 */
public void close(){
  closed=true;
  for (  IndexWriter writer : writers.values()) {
    IOUtils.closeQuietly(writer);
  }
}

Fixed version (ground truth):
/** 
 * Method should be called when done indexing.
 */
public void close(){
  closed=true;
  IOUtils.closeQuietly(writer);
}
Program: 53015
Project: 53015
Buggy source:
/** 
 * Build a LocalPage from a database record representation. Classes that extend class this should override this method.
 * @param record a database record
 * @return a LocalPage representation of the given database record
 * @throws DaoException if the record is not a Page
 */
protected LocalPage buildLocalPage(Record record) throws DaoException {
  if (record == null) {
    return null;
  }
  Language lang=Language.getById(record.getValue(Tables.LOCAL_PAGE.LANG_ID));
  if (record.getValue(Tables.LOCAL_PAGE.IS_REDIRECT) && redirectSqlDao != null) {
    return getById(lang,redirectSqlDao.resolveRedirect(lang,record.getValue(Tables.LOCAL_PAGE.PAGE_ID)));
  }
  Title title=new Title(record.getValue(Tables.LOCAL_PAGE.TITLE),true,LanguageInfo.getByLanguage(lang));
  NameSpace nameSpace=NameSpace.getNameSpaceByArbitraryId(record.getValue(Tables.LOCAL_PAGE.NAME_SPACE));
  return new LocalPage(lang,record.getValue(Tables.LOCAL_PAGE.PAGE_ID),title,nameSpace,record.getValue(Tables.LOCAL_PAGE.IS_REDIRECT),record.getValue(Tables.LOCAL_PAGE.IS_DISAMBIG));
}

Fixed version (ground truth):
protected LocalPage buildLocalPage(Record record,DaoFilter daoFilter) throws DaoException {
  if (record == null) {
    return null;
  }
  Language lang=Language.getById(record.getValue(Tables.LOCAL_PAGE.LANG_ID));
  if (redirectSqlDao != null && (daoFilter.isRedirect() == null || !daoFilter.isRedirect()) && record.getValue(Tables.LOCAL_PAGE.IS_REDIRECT)) {
    LocalPage page=getById(lang,redirectSqlDao.resolveRedirect(lang,record.getValue(Tables.LOCAL_PAGE.PAGE_ID)));
    if (daoFilter.isValidLocalPage(page)) {
      return page;
    }
  }
  Title title=new Title(record.getValue(Tables.LOCAL_PAGE.TITLE),true,LanguageInfo.getByLanguage(lang));
  NameSpace nameSpace=NameSpace.getNameSpaceByArbitraryId(record.getValue(Tables.LOCAL_PAGE.NAME_SPACE));
  return new LocalPage(lang,record.getValue(Tables.LOCAL_PAGE.PAGE_ID),title,nameSpace,record.getValue(Tables.LOCAL_PAGE.IS_REDIRECT),record.getValue(Tables.LOCAL_PAGE.IS_DISAMBIG));
}
Program: 53016
Project: 53016
Buggy source:
@Override public T transform(Record r){
  try {
    return (T)buildLocalPage(r);
  }
 catch (  DaoException e) {
    LOG.log(Level.WARNING,e.getMessage(),e);
    return null;
  }
}

Fixed version (ground truth):
@Override public T transform(Record r){
  try {
    return (T)buildLocalPage(r,daoFilter);
  }
 catch (  DaoException e) {
    LOG.log(Level.WARNING,e.getMessage(),e);
    return null;
  }
}
Program: 53017
Project: 53017
Buggy source:
private void cleanupWorkers(){
  finished.set(true);
  for (  Thread w : workers) {
    try {
      w.join(10000);
    }
 catch (    InterruptedException e) {
      LOG.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  for (  Thread w : workers) {
    w.interrupt();
  }
}

Fixed version (ground truth):
private void cleanupWorkers(){
  for (  Thread w : workers) {
    try {
      w.join(2 * 60 * 1000);
    }
 catch (    InterruptedException e) {
      LOG.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  for (  Thread w : workers) {
    w.interrupt();
  }
}
Program: 53018
Project: 53018
Buggy source:
public void load(Language language) throws WikapidiaException {
  try {
    createWorkers();
    int i=0;
    Iterable<RawPage> rawPages=rawPageDao.get(new DaoFilter().setLanguages(language).setNameSpaces(namespaces));
    for (    RawPage rawPage : rawPages) {
      queue.put(rawPage);
      if (++i % 1000 == 0)       LOG.log(Level.INFO,"String_Node_Str" + i);
    }
  }
 catch (  DaoException e) {
    throw new WikapidiaException(e);
  }
catch (  InterruptedException e) {
    throw new WikapidiaException(e);
  }
 finally {
    cleanupWorkers();
  }
}

Fixed version (ground truth):
public void load(Language language) throws WikapidiaException {
  try {
    createWorkers();
    int i=0;
    Iterable<RawPage> rawPages=rawPageDao.get(new DaoFilter().setLanguages(language).setNameSpaces(namespaces).setRedirect(false));
    for (    RawPage rawPage : rawPages) {
      queue.put(rawPage);
      if (++i % 1000 == 0)       LOG.log(Level.INFO,"String_Node_Str" + i);
    }
    queue.put(new RawPage(-2,0,"String_Node_Str",null,null,Language.getByLangCode("String_Node_Str"),null));
  }
 catch (  DaoException e) {
    throw new WikapidiaException(e);
  }
catch (  InterruptedException e) {
    throw new WikapidiaException(e);
  }
 finally {
    cleanupWorkers();
  }
}
Program: 53019
Project: 53019
Buggy source:
private void createWorkers(){
  workers.clear();
  finished.set(false);
  for (int i=0; i < WpThreadUtils.getMaxThreads(); i++) {
    Thread t=new Thread(new Worker());
    t.start();
    workers.add(t);
  }
}

Fixed version (ground truth):
private void createWorkers(){
  workers.clear();
  for (int i=0; i < WpThreadUtils.getMaxThreads(); i++) {
    Thread t=new Thread(new Worker());
    t.start();
    workers.add(t);
  }
}
Program: 53020
Project: 53020
Buggy source:
@Override public void run(){
  RawPage rp=null;
  while (!finished.get()) {
    try {
      rp=queue.poll(100,TimeUnit.MILLISECONDS);
      if (rp != null) {
        luceneIndexer.indexPage(rp);
      }
    }
 catch (    InterruptedException e) {
      LOG.log(Level.WARNING,"String_Node_Str");
      return;
    }
catch (    Exception e) {
      String title="String_Node_Str";
      if (rp != null)       title=rp.getTitle().toString();
      LOG.log(Level.WARNING,"String_Node_Str" + title,e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  RawPage rp=null;
  boolean finished=false;
  while (!finished) {
    try {
      rp=queue.poll(100,TimeUnit.MILLISECONDS);
      if (rp != null) {
        if (rp.getLocalId() == -2) {
          queue.put(rp);
          finished=true;
        }
 else {
          luceneIndexer.indexPage(rp);
        }
      }
    }
 catch (    InterruptedException e) {
      LOG.log(Level.WARNING,"String_Node_Str");
      return;
    }
catch (    Exception e) {
      String title="String_Node_Str";
      if (rp != null)       title=rp.getTitle().toString();
      LOG.log(Level.WARNING,"String_Node_Str" + title,e);
    }
  }
}
Program: 53021
Project: 53021
Buggy source:
/** 
 * Builds a MoreLikeThis query for the specified luceneId over the specified text field.
 * @param fieldName
 * @param luceneId
 * @return
 * @throws DaoException
 */
public QueryBuilder setMoreLikeThisQuery(String fieldName,int luceneId) throws DaoException {
  if (luceneId >= 0) {
    try {
      MoreLikeThis mlt=new MoreLikeThis(searcher.getReaderByLanguage(language));
      mlt.setMaxDocFreqPct(maxPercentage);
      mlt.setMaxQueryTerms(maxQueryTerms);
      mlt.setMinDocFreq(minDocFreq);
      mlt.setMinTermFreq(minTermFreq);
      mlt.setAnalyzer(searcher.getAnalyzerByLanguage(language));
      mlt.setFieldNames(new String[]{fieldName});
      query=mlt.like(luceneId);
    }
 catch (    IOException e) {
      LOG.log(Level.WARNING,"String_Node_Str" + luceneId);
    }
  }
 else {
    LOG.log(Level.WARNING,"String_Node_Str" + luceneId);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Builds a MoreLikeThis query for the specified luceneId over the specified text field.
 * @param fieldName
 * @param luceneId
 * @return
 * @throws DaoException
 */
public QueryBuilder setMoreLikeThisQuery(String fieldName,int luceneId) throws DaoException {
  if (luceneId >= 0) {
    try {
      MoreLikeThis mlt=new MoreLikeThis(searcher.getReaderByLanguage(language));
      mlt.setMaxDocFreqPct(maxPercentage);
      mlt.setMaxQueryTerms(maxQueryTerms);
      mlt.setMinDocFreq(minDocFreq);
      mlt.setMinTermFreq(minTermFreq);
      mlt.setAnalyzer(searcher.getAnalyzerByLanguage(language));
      mlt.setFieldNames(new String[]{fieldName});
      query=mlt.like(luceneId);
    }
 catch (    IOException e) {
      LOG.log(Level.WARNING,"String_Node_Str" + luceneId);
    }
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + luceneId);
  }
  return this;
}
Program: 53022
Project: 53022
Buggy source:
@Test @Ignore public void testGetDoc() throws ConfigurationException, IOException, DaoException {
  Configurator conf=new Configurator(new Configuration());
  RawPageDao rawPageDao=conf.get(RawPageDao.class);
  LuceneOptions[] luceneOptions=new LuceneOptions[]{conf.get(LuceneOptions.class)};
  Collection<NameSpace> namespaces=luceneOptions[0].namespaces;
  Language lang=Language.getByLangCode("String_Node_Str");
  LuceneSearcher searcher=new LuceneSearcher(new LanguageSet(Arrays.asList(lang)),LuceneOptions.getDefaultOptions());
  int localId=1;
  int luceneId=searcher.getDocIdFromLocalId(localId,lang);
  System.out.println(luceneId);
  Document doc=searcher.getSearcherByLanguage(lang).doc(luceneId);
  System.out.println(doc.toString());
}

Fixed version (ground truth):
@Ignore @Test public void testGetDoc() throws ConfigurationException, IOException, DaoException {
  Configurator conf=new Configurator(new Configuration());
  RawPageDao rawPageDao=conf.get(RawPageDao.class);
  LuceneOptions[] luceneOptions=new LuceneOptions[]{conf.get(LuceneOptions.class)};
  Collection<NameSpace> namespaces=luceneOptions[0].namespaces;
  Language lang=Language.getByLangCode("String_Node_Str");
  LuceneSearcher searcher=new LuceneSearcher(new LanguageSet(Collections.singletonList(lang)),LuceneOptions.getDefaultOptions());
  int localId=410732;
  int luceneId=searcher.getDocIdFromLocalId(localId,lang);
  System.out.println(luceneId);
  Document doc=searcher.getSearcherByLanguage(lang).doc(luceneId);
  System.out.println(doc.toString());
}
Program: 53023
Project: 53023
Buggy source:
/** 
 * Get concept vector of a local page with a specified language.
 * @param id
 * @param language
 * @return
 * @throws DaoException
 */
public TIntDoubleHashMap getVector(int id,Language language) throws DaoException {
  int luceneId=searcher.getDocIdFromLocalId(id,language);
  WikapidiaScoreDoc[] wikapidiaScoreDocs=getQueryBuilderByLanguage(language).setMoreLikeThisQuery(luceneId).search();
  wikapidiaScoreDocs=SimUtils.pruneSimilar(wikapidiaScoreDocs);
  return SimUtils.normalizeVector(expandScores(wikapidiaScoreDocs));
}

Fixed version (ground truth):
/** 
 * Get concept vector of a local page with a specified language.
 * @param id
 * @param language
 * @return
 * @throws DaoException
 */
public TIntDoubleHashMap getVector(int id,Language language) throws DaoException {
  int luceneId=searcher.getDocIdFromLocalId(id,language);
  if (luceneId < 0) {
    throw new DaoException("String_Node_Str" + id + "String_Node_Str"+ language.getEnLangName());
  }
  WikapidiaScoreDoc[] wikapidiaScoreDocs=getQueryBuilderByLanguage(language).setMoreLikeThisQuery(luceneId).search();
  wikapidiaScoreDocs=SimUtils.pruneSimilar(wikapidiaScoreDocs);
  return SimUtils.normalizeVector(expandScores(wikapidiaScoreDocs));
}
Program: 53024
Project: 53024
Buggy source:
private void writeSim(Integer wpId,int maxSimsPerDoc) throws IOException {
  if (idCounter.incrementAndGet() % 10000 == 0) {
    String nValidStr=(validIds == null) ? "String_Node_Str" : ("String_Node_Str" + validIds.size());
    System.err.println("String_Node_Str" + new Date() + "String_Node_Str"+ idCounter.get()+ "String_Node_Str"+ usedIds.size()+ "String_Node_Str"+ nValidStr);
  }
  SRResultList scores=metric.mostSimilar(wpId,maxSimsPerDoc,validIds);
  if (scores != null) {
    int ids[]=scores.getIds();
synchronized (this) {
      numCells+=scores.getIds().length;
      usedIds.addAll(ids);
    }
    writer.writeRow(new SparseMatrixRow(vconf,wpId,ids,scores.getScoresAsFloat()));
  }
}

Fixed version (ground truth):
private void writeSim(Integer wpId,int maxSimsPerDoc) throws IOException {
  if (idCounter.incrementAndGet() % 10000 == 0) {
    String nValidStr=(validIds == null) ? "String_Node_Str" : ("String_Node_Str" + validIds.size());
    LOG.info("String_Node_Str" + idCounter.get() + "String_Node_Str"+ usedIds.size()+ "String_Node_Str"+ nValidStr);
  }
  SRResultList scores=metric.mostSimilar(wpId,maxSimsPerDoc,validIds);
  if (scores != null) {
    int ids[]=scores.getIds();
synchronized (this) {
      numCells+=scores.getIds().length;
      usedIds.addAll(ids);
    }
    writer.writeRow(new SparseMatrixRow(vconf,wpId,ids,scores.getScoresAsFloat()));
  }
}
Program: 53025
Project: 53025
Buggy source:
/** 
 * Builds a phrase query over the specified field.
 * @param fieldName the name of the field on which to search
 * @param searchString
 * @return
 */
public QueryBuilder setPhraseQuery(String fieldName,String searchString){
  QueryParser parser=new QueryParser(searcher.getOptions().matchVersion,fieldName,searcher.getAnalyzerByLanguage(language));
  try {
    searchString=StringUtils.replace(searchString,"String_Node_Str","String_Node_Str");
    query=parser.parse(QueryParserUtil.escape(searchString));
    return this;
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Builds a phrase query over the specified field.
 * @param fieldName the name of the field on which to search
 * @param searchString
 * @return
 */
public QueryBuilder setPhraseQuery(String fieldName,String searchString){
  QueryParser parser=new QueryParser(searcher.getOptions().matchVersion,fieldName,searcher.getAnalyzerByLanguage(language));
  try {
    searchString=QueryParserUtil.escape(searchString);
    searchString=StringUtils.replace(searchString,"String_Node_Str","String_Node_Str");
    query=parser.parse(QueryParserUtil.escape(searchString));
    return this;
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}
Program: 53026
Project: 53026
Buggy source:
/** 
 * Builds a phrase query over the specified field.
 * @param fieldName the name of the field on which to search
 * @param searchString
 * @return
 */
public QueryBuilder setPhraseQuery(String fieldName,String searchString){
  QueryParser parser=new QueryParser(searcher.getOptions().matchVersion,fieldName,searcher.getAnalyzerByLanguage(language));
  try {
    searchString=QueryParserUtil.escape(searchString);
    searchString=StringUtils.replace(searchString,"String_Node_Str","String_Node_Str");
    query=parser.parse(QueryParserUtil.escape(searchString));
    return this;
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Builds a phrase query over the specified field.
 * @param fieldName the name of the field on which to search
 * @param searchString
 * @return
 */
public QueryBuilder setPhraseQuery(String fieldName,String searchString){
  QueryParser parser=new QueryParser(searcher.getOptions().matchVersion,fieldName,searcher.getAnalyzerByLanguage(language));
  try {
    searchString=QueryParserUtil.escape(searchString);
    searchString=StringUtils.replace(searchString,"String_Node_Str","String_Node_Str");
    query=parser.parse(searchString);
    return this;
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}
Program: 53027
Project: 53027
Buggy source:
protected double normalize(double score,Language language){
  if (similarityNormalizers.containsKey((int)language.getId())) {
    return similarityNormalizers.get((int)language.getId()).normalize(score);
  }
  ensureMostSimilarTrained();
  return defaultMostSimilarNormalizer.normalize(score);
}

Fixed version (ground truth):
protected double normalize(double score,Language language){
  if (similarityNormalizers.containsKey((int)language.getId()) && similarityNormalizers.get((int)language.getId()).isTrained()) {
    return similarityNormalizers.get((int)language.getId()).normalize(score);
  }
  ensureSimilarityTrained();
  return defaultSimilarityNormalizer.normalize(score);
}
Program: 53028
Project: 53028
Buggy source:
@Override protected Analyzer.TokenStreamComponents createComponents(String s,Reader r){
  TokenStream result=tokenizer.getTokenStream(r,CharArraySet.EMPTY_SET);
  return new TokenStreamComponents(tokenizer.getTokenizer(),result);
}

Fixed version (ground truth):
@Override protected Analyzer.TokenStreamComponents createComponents(String s,Reader r){
  Tokenizer tokenizer=languageTokenizer.makeTokenizer(r);
  TokenStream result=languageTokenizer.getTokenStream(tokenizer,CharArraySet.EMPTY_SET);
  return new TokenStreamComponents(tokenizer,result);
}
Program: 53029
Project: 53029
Buggy source:
/** 
 * Constructs a WikapidiaAnalyzer for the specified language with specified filters and specified options.
 * @param language the language this analyzer analyzes
 * @param options a LuceneOptions object containing specific options for lucene
 */
public WikapidiaAnalyzer(Language language,LuceneOptions options){
  this.language=language;
  this.tokenizer=LanguageTokenizer.getLanguageTokenizer(language,options);
  this.options=options;
}

Fixed version (ground truth):
/** 
 * Constructs a WikapidiaAnalyzer for the specified language with specified filters and specified options.
 * @param language the language this analyzer analyzes
 * @param options a LuceneOptions object containing specific options for lucene
 */
public WikapidiaAnalyzer(Language language,LuceneOptions options){
  this.language=language;
  this.languageTokenizer=LanguageTokenizer.getLanguageTokenizer(language,options);
  this.options=options;
}
Program: 53030
Project: 53030
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  stream=new ArabicNormalizationFilter(stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,ArabicAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new ArabicStemFilter(stream);
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  stream=new ArabicNormalizationFilter(stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,ArabicAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new ArabicStemFilter(stream);
  }
  return stream;
}
Program: 53031
Project: 53031
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,ArmenianAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new ArmenianStemmer());
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,ArmenianAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new ArmenianStemmer());
  }
  return stream;
}
Program: 53032
Project: 53032
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,BasqueAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new BasqueStemmer());
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,BasqueAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new BasqueStemmer());
  }
  return stream;
}
Program: 53033
Project: 53033
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,BulgarianAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new BulgarianStemFilter(stream);
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,BulgarianAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new BulgarianStemFilter(stream);
  }
  return stream;
}
Program: 53034
Project: 53034
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords) {
    stream=new ElisionFilter(stream,DEFAULT_ARTICLES);
    stream=new StopFilter(matchVersion,stream,DanishAnalyzer.getDefaultStopSet());
  }
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new CatalanStemmer());
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords) {
    stream=new ElisionFilter(stream,DEFAULT_ARTICLES);
    stream=new StopFilter(matchVersion,stream,DanishAnalyzer.getDefaultStopSet());
  }
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new CatalanStemmer());
  }
  return stream;
}
Program: 53035
Project: 53035
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new WordTokenFilter(stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,SmartChineseAnalyzer.getDefaultStopSet());
  if (useStem)   stream=new PorterStemFilter(stream);
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new WordTokenFilter(tokenizer);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,SmartChineseAnalyzer.getDefaultStopSet());
  if (useStem)   stream=new PorterStemFilter(stream);
  return stream;
}
Program: 53036
Project: 53036
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,CzechAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new CzechStemFilter(stream);
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,CzechAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new CzechStemFilter(stream);
  }
  return stream;
}
Program: 53037
Project: 53037
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,DanishAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new DanishStemmer());
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,DanishAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new DanishStemmer());
  }
  return stream;
}
Program: 53038
Project: 53038
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  return stream;
}
Program: 53039
Project: 53039
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,DutchAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new DutchStemmer());
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,DutchAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new DutchStemmer());
  }
  return stream;
}
Program: 53040
Project: 53040
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,EnglishAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new EnglishPossessiveFilter(matchVersion,stream);
    stream=new PorterStemFilter(stream);
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,EnglishAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new EnglishPossessiveFilter(matchVersion,stream);
    stream=new PorterStemFilter(stream);
  }
  return stream;
}
Program: 53041
Project: 53041
Buggy source:
@Override public TokenStream getTokenStream(Reader reader,CharArraySet stemExclusionSet){
  TokenStream stream=setTokenizer(reader);
  stream=new StandardFilter(matchVersion,stream);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,FinnishAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new FinnishStemmer());
  }
  return stream;
}

Fixed version (ground truth):
@Override public TokenStream getTokenStream(Tokenizer tokenizer,CharArraySet stemExclusionSet){
  TokenStream stream=new StandardFilter(matchVersion,tokenizer);
  if (caseInsensitive)   stream=new LowerCaseFilter(matchVersion,stream);
  if (useStopWords)   stream=new StopFilter(matchVersion,stream,FinnishAnalyzer.getDefaultStopSet());
  if (useStem) {
    if (!stemExclusionSet.isEmpty())     stream=new SetKeywordMarkerFilter(stream,stemExclusionSet);
    stream=new SnowballFilter(stream,new FinnishStemmer());
  }
  return stream;
}
Program: 53042
Project: 53042
Buggy source:
@Override public void save(LocalLink item) throws DaoException {
  delegate.save(item);
  LocalId src=new LocalId(item.getLanguage(),item.getSourceId());
  LocalId dest=new LocalId(item.getLanguage(),item.getDestId());
  if (!src.canPackInInt() || !dest.canPackInInt()) {
    System.err.println("String_Node_Str");
    return;
  }
  System.err.println("String_Node_Str");
  try {
    String key="String_Node_Str" + src.toInt();
    int[] val=objectDb.get(key);
    objectDb.put(key,ArrayUtils.add(val,dest.toInt()));
  }
 catch (  IOException e) {
    throw new DaoException(e);
  }
catch (  ClassNotFoundException e) {
    throw new DaoException(e);
  }
}

Fixed version (ground truth):
@Override public void save(LocalLink item) throws DaoException {
  delegate.save(item);
  LocalId src=new LocalId(item.getLanguage(),item.getSourceId());
  LocalId dest=new LocalId(item.getLanguage(),item.getDestId());
  if (!src.canPackInInt() || !dest.canPackInInt()) {
    return;
  }
  try {
    String key="String_Node_Str" + src.toInt();
    int[] val=objectDb.get(key);
    objectDb.put(key,ArrayUtils.add(val,dest.toInt()));
  }
 catch (  IOException e) {
    throw new DaoException(e);
  }
catch (  ClassNotFoundException e) {
    throw new DaoException(e);
  }
}
Program: 53043
Project: 53043
Buggy source:
@Override public void endLoad() throws DaoException {
  delegate.endLoad();
  try {
    LOG.info("String_Node_Str");
    ValueConf vconf=new ValueConf();
    SparseMatrixWriter writer=new SparseMatrixWriter(getMatrixFile(),vconf);
    for (    Pair<String,int[]> entry : objectDb) {
      SparseMatrixRow row=new SparseMatrixRow(vconf,Integer.valueOf(entry.getKey()),entry.getValue(),new short[entry.getValue().length]);
      writer.writeRow(row);
    }
    LOG.info("String_Node_Str");
    writer.finish();
    LOG.info("String_Node_Str");
    matrix=new SparseMatrix(getMatrixFile(),maxOpenPages,maxPageSize);
    LOG.info("String_Node_Str");
    SparseMatrixTransposer transposer=new SparseMatrixTransposer(matrix,getTransposeFile(),maxOpenPages * maxPageSize);
    transposer.transpose();
    LOG.info("String_Node_Str");
    transpose=new SparseMatrix(getTransposeFile(),maxOpenPages,maxPageSize);
  }
 catch (  IOException e) {
    throw new DaoException(e);
  }
}

Fixed version (ground truth):
@Override public void endLoad() throws DaoException {
  delegate.endLoad();
  objectDb.flush();
  try {
    LOG.info("String_Node_Str");
    ValueConf vconf=new ValueConf();
    SparseMatrixWriter writer=new SparseMatrixWriter(getMatrixFile(),vconf);
    for (    Pair<String,int[]> entry : objectDb) {
      SparseMatrixRow row=new SparseMatrixRow(vconf,Integer.valueOf(entry.getKey()),entry.getValue(),new short[entry.getValue().length]);
      writer.writeRow(row);
    }
    LOG.info("String_Node_Str");
    writer.finish();
    LOG.info("String_Node_Str");
    matrix=new SparseMatrix(getMatrixFile(),maxOpenPages,maxPageSize);
    LOG.info("String_Node_Str");
    SparseMatrixTransposer transposer=new SparseMatrixTransposer(matrix,getTransposeFile(),maxOpenPages * maxPageSize);
    transposer.transpose();
    LOG.info("String_Node_Str");
    transpose=new SparseMatrix(getTransposeFile(),maxOpenPages,maxPageSize);
  }
 catch (  IOException e) {
    throw new DaoException(e);
  }
}
Program: 53044
Project: 53044
Buggy source:
public void flush(){
  this.db.sync();
}

Fixed version (ground truth):
public void flush(){
  this.env.flushLog(true);
}
Program: 53045
Project: 53045
Buggy source:
public static int getUniversalConceptAlgorithmId(Config conf){
  String path=conf.getString("String_Node_Str");
  return conf.getInt("String_Node_Str" + path + "String_Node_Str");
}

Fixed version (ground truth):
public static int getUniversalConceptAlgorithmId(Configuration conf){
  String path=conf.get().getString("String_Node_Str");
  return conf.get().getInt("String_Node_Str" + path + "String_Node_Str");
}
Program: 53046
Project: 53046
Buggy source:
@Override public UniversalSRMetric get(String name,Config config) throws ConfigurationException {
  if (!config.getString("String_Node_Str").equals("String_Node_Str")) {
    return null;
  }
  return new UniversalMilneWitten(getConfigurator().get(Disambiguator.class,config.getString("String_Node_Str")),getConfigurator().get(UniversalPageDao.class,config.getString("String_Node_Str")),Env.getUniversalConceptAlgorithmId(config),getConfigurator().get(UniversalLinkDao.class,config.getString("String_Node_Str")),config.getBoolean("String_Node_Str"));
}

Fixed version (ground truth):
@Override public UniversalSRMetric get(String name,Config config) throws ConfigurationException {
  if (!config.getString("String_Node_Str").equals("String_Node_Str")) {
    return null;
  }
  return new UniversalMilneWitten(getConfigurator().get(Disambiguator.class,config.getString("String_Node_Str")),getConfigurator().get(UniversalPageDao.class,config.getString("String_Node_Str")),Env.getUniversalConceptAlgorithmId(getConfig()),getConfigurator().get(UniversalLinkDao.class,config.getString("String_Node_Str")),config.getBoolean("String_Node_Str"));
}
Program: 53047
Project: 53047
Buggy source:
/** 
 * Get wiki pages that are the most similar to the specified local page.
 * @param localPage
 * @param maxResults
 * @param explanations
 * @return
 * @throws DaoException
 */
public SRResultList mostSimilar(LocalPage localPage,int maxResults,boolean explanations) throws DaoException {
  Language language=localPage.getLanguage();
  QueryBuilder queryBuilder=new QueryBuilder(language,searcher.getOptions());
  searcher.setHitCount(maxResults);
  Query query=queryBuilder.getMoreLikeThisQuery(searcher.getDocIdFromLocalId(localPage.getLocalId(),language),searcher.getReaderByLanguage(language));
  ScoreDoc[] scoreDocs=searcher.search(query,language);
  SRResultList srResults=new SRResultList(maxResults);
  int i=0;
  for (  ScoreDoc scoreDoc : scoreDocs) {
    if (i < srResults.numDocs()) {
      srResults.set(i,scoreDoc.doc,scoreDoc.score);
      i++;
    }
  }
  if (explanations) {
    String format="String_Node_Str";
    for (    SRResult srResult : srResults) {
      if (srResult.getValue() != 0) {
        List<LocalPage> formatPages=new ArrayList<LocalPage>();
        int localPageId=searcher.getLocalIdFromDocId(srResult.id,language);
        LocalPage topPage=pageHelper.getById(language,localPageId);
        if (topPage == null) {
          continue;
        }
        formatPages.add(localPage);
        formatPages.add(topPage);
        Explanation explanation=new Explanation(format,formatPages);
        srResult.addExplanation(explanation);
      }
    }
  }
  return srResults;
}

Fixed version (ground truth):
public SRResultList mostSimilar(LocalPage page,int maxResults,TIntSet validIds) throws DaoException {
  return null;
}
Program: 53050
Project: 53050
Buggy source:
/** 
 * Return all links of a particular language the fits one of the patterns
 * @return  hashmap with dump urls and names of dump type
 */
public Multimap<LinkMatcher,DumpLinkInfo> getDumpFiles(List<String> links) throws IOException {
  Multimap<LinkMatcher,DumpLinkInfo> dumpLinks=HashMultimap.create();
  Map<String,String> md5s=getMd5Sums(links);
  for (  LinkMatcher linkMatcher : matchers) {
    List<String> results=linkMatcher.match(links);
    if (!results.isEmpty()) {
      for (      String url : results) {
        URL linkURL=new URL(BASEURL_STRING + url);
        DumpLinkInfo linkInfo=new DumpLinkInfo(lang,dumpDate,linkMatcher,linkURL);
        linkInfo.setMd5(md5s.get(linkInfo.getDownloadName()));
        dumpLinks.put(linkMatcher,linkInfo);
      }
    }
  }
  return dumpLinks;
}

Fixed version (ground truth):
/** 
 * Return all links of a particular language the fits one of the patterns
 * @return  hashmap with dump urls and names of dump type
 */
public Multimap<LinkMatcher,DumpLinkInfo> getDumpFiles(List<String> links) throws IOException {
  Multimap<LinkMatcher,DumpLinkInfo> dumpLinks=HashMultimap.create();
  Map<String,String> md5s=getMd5Sums(links);
  for (  LinkMatcher linkMatcher : matchers) {
    List<String> results=linkMatcher.match(links);
    if (!results.isEmpty()) {
      for (      String url : results) {
        URL linkURL=new URL(BASEURL_STRING + url);
        DumpLinkInfo linkInfo=new DumpLinkInfo(lang,dumpDate,linkMatcher,linkURL,linkMatcher.getNumber(url));
        linkInfo.setMd5(md5s.get(linkInfo.getDownloadName()));
        dumpLinks.put(linkMatcher,linkInfo);
      }
    }
  }
  return dumpLinks;
}
Program: 53051
Project: 53051
Buggy source:
/** 
 * Parses a file of info pertaining to dump links into a cluster of DumpLinkInfo. Info must be listed in order: lang code, date, LinkMatcher, URL, MD5 checksum with each DumpLink reference on a new line.
 * @param file
 * @return
 */
public static DumpLinkCluster parseFile(File file){
  InputStream stream=null;
  Map<String,AtomicInteger> counters=new HashMap<String,AtomicInteger>();
  try {
    stream=FileUtils.openInputStream(file);
    List<String> lines=IOUtils.readLines(stream,"String_Node_Str");
    DumpLinkCluster dumpLinks=new DumpLinkCluster();
    for (    String line : lines) {
      String[] parsedInfo=line.split("String_Node_Str");
      String langCode=parsedInfo[0];
      String date=parsedInfo[1];
      String linkMatcher=parsedInfo[2];
      String url=parsedInfo[3];
      String md5=null;
      if (parsedInfo.length == 5)       md5=parsedInfo[4];
      try {
        if (!counters.containsKey(linkMatcher)) {
          counters.put(linkMatcher,new AtomicInteger(0));
        }
        DumpLinkInfo temp=new DumpLinkInfo(langCode,date,linkMatcher,url,md5,counters.get(linkMatcher).getAndIncrement());
        dumpLinks.add(temp);
      }
 catch (      MalformedURLException e) {
        LOG.log(Level.WARNING,"String_Node_Str" + url + "String_Node_Str",e);
      }
    }
    return dumpLinks;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    if (stream != null)     IOUtils.closeQuietly(stream);
  }
}

Fixed version (ground truth):
/** 
 * Parses a file of info pertaining to dump links into a cluster of DumpLinkInfo. Info must be listed in order: lang code, date, LinkMatcher, URL, MD5 checksum with each DumpLink reference on a new line.
 * @param file
 * @return
 */
public static DumpLinkCluster parseFile(File file){
  InputStream stream=null;
  try {
    stream=FileUtils.openInputStream(file);
    List<String> lines=IOUtils.readLines(stream,"String_Node_Str");
    DumpLinkCluster dumpLinks=new DumpLinkCluster();
    for (    String line : lines) {
      String[] parsedInfo=line.split("String_Node_Str");
      String langCode=parsedInfo[0];
      String date=parsedInfo[1];
      String linkMatcher=parsedInfo[2];
      String counter=parsedInfo[3];
      String url=parsedInfo[4];
      String md5=null;
      if (parsedInfo.length == 6)       md5=parsedInfo[5];
      try {
        DumpLinkInfo temp=new DumpLinkInfo(langCode,date,linkMatcher,url,md5,Integer.valueOf(counter));
        dumpLinks.add(temp);
      }
 catch (      MalformedURLException e) {
        LOG.log(Level.WARNING,"String_Node_Str" + url + "String_Node_Str",e);
      }
    }
    return dumpLinks;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    if (stream != null)     IOUtils.closeQuietly(stream);
  }
}
Program: 53053
Project: 53053
Buggy source:
@Override public void beginLoad() throws DaoException {
  executeSqlScriptWithSuffix("String_Node_Str");
  executeSqlScriptWithSuffix("String_Node_Str");
}

Fixed version (ground truth):
@Override public void beginLoad() throws DaoException {
  executeSqlScriptWithSuffix("String_Node_Str");
  executeSqlScriptWithSuffix("String_Node_Str");
  loader=new FastLoader(ds,fields);
}
Program: 53054
Project: 53054
Buggy source:
/** 
 * @param dataSource Data source for jdbc connections
 * @param fields Ordered list of fields for inserts into the database.
 * @param sqlScriptPrefix The prefix used to find sql scripts in the class path(e.g. "/db/raw-page"). This class will append "-create-tables.sql", "-create-indexes.sql", "-drop-tables.sql", and "-drop-indexes.sql" to the prefix to find sql scripts, and they all must exist. The create-tables script must ONLY create the table for the dao because it is used by the fast loader.
 * @throws DaoException
 */
public AbstractSqlDao(DataSource dataSource,TableField[] fields,String sqlScriptPrefix) throws DaoException {
  ds=dataSource;
  Connection conn=null;
  try {
    conn=ds.getConnection();
    this.dialect=JooqUtils.dialect(conn);
  }
 catch (  SQLException e) {
    throw new DaoException(e);
  }
 finally {
    quietlyCloseConn(conn);
  }
  cache=null;
  this.fields=fields;
  this.sqlScriptPrefix=sqlScriptPrefix;
  loader=new FastLoader(ds,fields);
}

Fixed version (ground truth):
/** 
 * @param dataSource Data source for jdbc connections
 * @param fields Ordered list of fields for inserts into the database.
 * @param sqlScriptPrefix The prefix used to find sql scripts in the class path(e.g. "/db/raw-page"). This class will append "-create-tables.sql", "-create-indexes.sql", "-drop-tables.sql", and "-drop-indexes.sql" to the prefix to find sql scripts, and they all must exist. The create-tables script must ONLY create the table for the dao because it is used by the fast loader.
 * @throws DaoException
 */
public AbstractSqlDao(DataSource dataSource,TableField[] fields,String sqlScriptPrefix) throws DaoException {
  ds=dataSource;
  Connection conn=null;
  try {
    conn=ds.getConnection();
    this.dialect=JooqUtils.dialect(conn);
  }
 catch (  SQLException e) {
    throw new DaoException(e);
  }
 finally {
    quietlyCloseConn(conn);
  }
  cache=null;
  this.fields=fields;
  this.sqlScriptPrefix=sqlScriptPrefix;
}
Program: 53055
Project: 53055
Buggy source:
public ESAMetric(Language language) throws WikapidiaException {
  this.language=language;
  searcher=new LuceneSearcher(new LanguageSet(language.getLangCode()),LuceneOptions.getDefaultOptions());
}

Fixed version (ground truth):
public ESAMetric(Language language){
  this.language=language;
  searcher=new LuceneSearcher(new LanguageSet(language.getLangCode()),LuceneOptions.getDefaultOptions());
}
Program: 53056
Project: 53056
Buggy source:
/** 
 * Get concept vector of a local page with a specified language.
 * @param localPage
 * @param language
 * @return
 * @throws DaoException
 */
public TIntDoubleHashMap getConceptVector(LocalPage localPage,Language language) throws DaoException {
  QueryBuilder queryBuilder=new QueryBuilder(language,searcher.getOptions());
  ScoreDoc[] scoreDocs=searcher.search(queryBuilder.getLocalPageConceptQuery(localPage),language);
  TIntDoubleHashMap result=SimUtils.normalizeVector(expandScores(scoreDocs));
  return result;
}

Fixed version (ground truth):
/** 
 * Get concept vector of a local page with a specified language.
 * @param localPage
 * @param language
 * @return
 * @throws DaoException
 */
public TIntDoubleHashMap getConceptVector(LocalPage localPage,Language language) throws DaoException {
  QueryBuilder queryBuilder=new QueryBuilder(language,searcher.getOptions());
  ScoreDoc[] scoreDocs=searcher.search(queryBuilder.getLocalPageConceptQuery(localPage),language);
  return SimUtils.normalizeVector(expandScores(scoreDocs));
}
Program: 53057
Project: 53057
Buggy source:
@Override public SRResultList mostSimilar(LocalPage localPage,int maxResults,boolean explanations,TIntSet validIds) throws DaoException, WikapidiaException {
  return null;
}

Fixed version (ground truth):
@Override public SRResultList mostSimilar(LocalPage localPage,int maxResults,boolean explanations,TIntSet validIds) throws DaoException {
  return null;
}