nus-yam/ex-repair huggingface dataset:
Program: 52970
Project: 52970
Buggy source:
public Iterable<LocalLink> getLinks(Language language,int localId,boolean outlinks) throws DaoException {
  List<LocalLink> links=new ArrayList<LocalLink>();
  LiveAPIQuery.LiveAPIQueryBuilder builder;
  if (outlinks) {
    builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  }
 else {
    builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  }
  builder.setPageid(localId);
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    LocalLink link=outlinks ? reply.getLocalOutLink(language,localId) : reply.getLocalInLink(language,localId);
    links.add(link);
  }
  return links;
}

Fixed version (ground truth):
public Iterable<LocalLink> getLinks(Language language,int localId,boolean outlinks) throws DaoException {
  List<LocalLink> links=new ArrayList<LocalLink>();
  LiveAPIQuery.LiveAPIQueryBuilder builder;
  if (outlinks) {
    builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  }
 else {
    builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  }
  builder.addPageid(localId);
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    LocalLink link=outlinks ? reply.getLocalOutLink(language,localId) : reply.getLocalInLink(language,localId);
    links.add(link);
  }
  return links;
}
Program: 52971
Project: 52971
Buggy source:
public LocalLink getLink(Language language,int sourceId,int destId) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  builder.setPageid(sourceId);
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    int pageId=reply.pageId;
    if (pageId == destId) {
      return reply.getLocalOutLink(language,sourceId);
    }
  }
  throw new DaoException("String_Node_Str");
}

Fixed version (ground truth):
public LocalLink getLink(Language language,int sourceId,int destId) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  builder.addPageid(sourceId);
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    int pageId=reply.pageId;
    if (pageId == destId) {
      return reply.getLocalOutLink(language,sourceId);
    }
  }
  throw new DaoException("String_Node_Str");
}
Program: 52972
Project: 52972
Buggy source:
/** 
 * Get an id from a title. Returns -1 if it doesn't exist.
 * @param title
 * @return
 */
public int getIdByTitle(Title title) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",title.getLanguage()).setTitle(title.getCanonicalTitle().replace("String_Node_Str","String_Node_Str")).setRedirects(followRedirects);
  QueryReply info=builder.build().getValuesFromQueryResult().get(0);
  return info.getId();
}

Fixed version (ground truth):
/** 
 * Get an id from a title. Returns -1 if it doesn't exist.
 * @param title
 * @return
 */
public int getIdByTitle(Title title) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",title.getLanguage()).addTitle(title.getCanonicalTitle().replace("String_Node_Str","String_Node_Str")).setRedirects(followRedirects);
  QueryReply info=builder.build().getValuesFromQueryResult().get(0);
  return info.getId();
}
Program: 52973
Project: 52973
Buggy source:
/** 
 * Get a single page by its title
 * @param title the page's title
 * @param ns the page's namespace
 * @return the requested LocalPage
 * @throws org.wikapidia.core.dao.DaoException if there was an error retrieving the page
 */
public T getByTitle(Title title,NameSpace ns) throws DaoException {
  Language lang=title.getLanguage();
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang).setTitle(title.getCanonicalTitle().replace("String_Node_Str","String_Node_Str")).setRedirects(followRedirects);
  QueryReply info=builder.build().getValuesFromQueryResult().get(0);
  return (T)info.getLocalPage(lang);
}

Fixed version (ground truth):
/** 
 * Get a single page by its title
 * @param title the page's title
 * @param ns the page's namespace
 * @return the requested LocalPage
 * @throws org.wikapidia.core.dao.DaoException if there was an error retrieving the page
 */
public T getByTitle(Title title,NameSpace ns) throws DaoException {
  Language lang=title.getLanguage();
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang).addTitle(title.getCanonicalTitle().replace("String_Node_Str","String_Node_Str")).setRedirects(followRedirects);
  QueryReply info=builder.build().getValuesFromQueryResult().get(0);
  return (T)info.getLocalPage(lang);
}
Program: 52974
Project: 52974
Buggy source:
/** 
 * Get a set of pages by their ids
 * @param language the language of the pages
 * @param pageIds a Collection of page ids
 * @return a map of ids to pages
 * @throws org.wikapidia.core.dao.DaoException if there was an error retrieving the pages
 */
public Map<Integer,T> getByIds(Language language,Collection<Integer> pageIds) throws DaoException {
  Map<Integer,T> pageMap=new HashMap<Integer,T>();
  for (  Integer pageId : pageIds) {
    LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language).setPageid(pageId).setRedirects(followRedirects);
    QueryReply info=builder.build().getValuesFromQueryResult().get(0);
    pageMap.put(pageId,(T)info.getLocalPage(language));
  }
  return pageMap;
}

Fixed version (ground truth):
/** 
 * Get a set of pages by their ids
 * @param language the language of the pages
 * @param pageIds a Collection of page ids
 * @return a map of ids to pages
 * @throws org.wikapidia.core.dao.DaoException if there was an error retrieving the pages
 */
public Map<Integer,T> getByIds(Language language,Collection<Integer> pageIds) throws DaoException {
  Map<Integer,T> pageMap=new HashMap<Integer,T>();
  for (  Integer pageId : pageIds) {
    LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language).addPageid(pageId).setRedirects(followRedirects);
    QueryReply info=builder.build().getValuesFromQueryResult().get(0);
    pageMap.put(pageId,(T)info.getLocalPage(language));
  }
  return pageMap;
}
Program: 52975
Project: 52975
Buggy source:
public T getById(Language language,int pageId) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language).setPageid(pageId).setRedirects(followRedirects);
  QueryReply info=builder.build().getValuesFromQueryResult().get(0);
  return (T)info.getLocalPage(language);
}

Fixed version (ground truth):
public T getById(Language language,int pageId) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language).addPageid(pageId).setRedirects(followRedirects);
  QueryReply info=builder.build().getValuesFromQueryResult().get(0);
  return (T)info.getLocalPage(language);
}
Program: 52976
Project: 52976
Buggy source:
/** 
 * Get a map of pages by their titles
 * @param language the language of the pages
 * @param titles a Collection of page titles
 * @param ns the namespace of the pages
 * @return a map of titles to pages
 * @throws org.wikapidia.core.dao.DaoException if there was an error retrieving the pages
 */
public Map<Title,T> getByTitles(Language language,Collection<Title> titles,NameSpace ns) throws DaoException {
  Map<Title,T> pageMap=new HashMap<Title,T>();
  for (  Title title : titles) {
    LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language).setTitle(title.getCanonicalTitle().replace("String_Node_Str","String_Node_Str")).setRedirects(followRedirects);
    QueryReply info=builder.build().getValuesFromQueryResult().get(0);
    pageMap.put(title,(T)info.getLocalPage(language));
  }
  return pageMap;
}

Fixed version (ground truth):
/** 
 * Get a map of pages by their titles
 * @param language the language of the pages
 * @param titles a Collection of page titles
 * @param ns the namespace of the pages
 * @return a map of titles to pages
 * @throws org.wikapidia.core.dao.DaoException if there was an error retrieving the pages
 */
public Map<Title,T> getByTitles(Language language,Collection<Title> titles,NameSpace ns) throws DaoException {
  Map<Title,T> pageMap=new HashMap<Title,T>();
  for (  Title title : titles) {
    LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language).addTitle(title.getCanonicalTitle().replace("String_Node_Str","String_Node_Str")).setRedirects(followRedirects);
    QueryReply info=builder.build().getValuesFromQueryResult().get(0);
    pageMap.put(title,(T)info.getLocalPage(language));
  }
  return pageMap;
}
Program: 52977
Project: 52977
Buggy source:
public List<Integer> getRedirectsFromId(Language lang,int localId) throws DaoException {
  List<Integer> redirectIds=new ArrayList<Integer>();
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang);
  builder.setPageid(localId).setFilterredir("String_Node_Str");
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    redirectIds.add(reply.pageId);
  }
  return redirectIds;
}

Fixed version (ground truth):
public List<Integer> getRedirectsFromId(Language lang,int localId) throws DaoException {
  List<Integer> redirectIds=new ArrayList<Integer>();
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang);
  builder.addPageid(localId).setFilterredir("String_Node_Str");
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    redirectIds.add(reply.pageId);
  }
  return redirectIds;
}
Program: 52978
Project: 52978
Buggy source:
public Integer resolveRedirect(Language lang,int id) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang);
  builder.setPageid(id).setRedirects(true);
  LiveAPIQuery query=builder.build();
  int redirectId=query.getValuesFromQueryResult().get(0).pageId;
  if (redirectId != id) {
    return redirectId;
  }
  return null;
}

Fixed version (ground truth):
public Integer resolveRedirect(Language lang,int id) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang);
  builder.addPageid(id).setRedirects(true);
  LiveAPIQuery query=builder.build();
  int redirectId=query.getValuesFromQueryResult().get(0).pageId;
  if (redirectId != id) {
    return redirectId;
  }
  return null;
}
Program: 52979
Project: 52979
Buggy source:
public boolean isRedirect(Language lang,int id) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang);
  builder.setPageid(id);
  LiveAPIQuery query=builder.build();
  return query.getValuesFromQueryResult().get(0).isRedirect;
}

Fixed version (ground truth):
public boolean isRedirect(Language lang,int id) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang);
  builder.addPageid(id);
  LiveAPIQuery query=builder.build();
  return query.getValuesFromQueryResult().get(0).isRedirect;
}
Program: 52980
Project: 52980
Buggy source:
public TIntIntMap getAllRedirectIdsToDestIds(Language lang) throws DaoException {
  TIntIntMap redirects=new TIntIntHashMap();
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang);
  builder.setFilterredir("String_Node_Str").setFrom("String_Node_Str");
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    int destId=resolveRedirect(lang,reply.pageId);
    redirects.put(reply.pageId,destId);
  }
  return redirects;
}

Fixed version (ground truth):
public TIntIntMap getAllRedirectIdsToDestIds(Language lang) throws DaoException {
  TIntIntMap redirectToDestIds=new TIntIntHashMap();
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",lang);
  builder.setFilterredir("String_Node_Str").setFrom("String_Node_Str");
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  int i=0;
  int numReplies=replyObjects.size();
  while (i < numReplies) {
    int batchEndPosn=((numReplies - i) > 500) ? i+=500 : numReplies;
    List<QueryReply> batchReplies=replyObjects.subList(i,batchEndPosn);
    List<Integer> redirectIds=new ArrayList<Integer>();
    for (    QueryReply reply : batchReplies) {
      redirectIds.add(reply.getId());
    }
    Map<Integer,Integer> batch=resolveRedirects(lang,redirectIds);
    for (    int redirectId : batch.keySet()) {
      redirectToDestIds.put(redirectId,batch.get(redirectId));
    }
  }
  return redirectToDestIds;
}
Program: 52981
Project: 52981
Buggy source:
private static File downloadFile(String folderUrl,String fileName,File localFolder){
  try {
    System.out.println("String_Node_Str");
    URL url=new URL(folderUrl + fileName);
    String localPath=localFolder.getAbsolutePath() + "String_Node_Str" + fileName;
    File dest=new File(localPath);
    if (!dest.exists()) {
      System.out.println("String_Node_Str");
      FileUtils.copyURLToFile(url,dest,60000,60000);
    }
 else {
      System.out.println("String_Node_Str");
    }
    File ungzipDest=new File(localPath.split("String_Node_Str")[0] + "String_Node_Str");
    if (!ungzipDest.exists()) {
      ungzip(dest,ungzipDest);
    }
    System.out.println("String_Node_Str");
    return ungzipDest;
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
private static File downloadFile(String folderUrl,String fileName,File localFolder){
  try {
    System.out.println("String_Node_Str");
    URL url=new URL(folderUrl + fileName);
    String localPath=localFolder.getAbsolutePath() + "String_Node_Str" + fileName;
    File dest=new File(localPath);
    if (!dest.exists()) {
      System.out.println("String_Node_Str");
      FileUtils.copyURLToFile(url,dest,60000,60000);
    }
 else {
      System.out.println("String_Node_Str");
    }
    File ungzipDest=new File(localPath.split("String_Node_Str")[0] + "String_Node_Str");
    if (!ungzipDest.exists()) {
      ungzip(dest,ungzipDest);
    }
    System.out.println("String_Node_Str");
    return ungzipDest;
  }
 catch (  IOException e) {
    System.out.println("String_Node_Str" + fileName + "String_Node_Str");
    return null;
  }
}
Program: 52982
Project: 52982
Buggy source:
private static TIntIntMap parsePageViewDataFromFile(Language lang,File f) throws WikapidiaException, DaoException, ConfigurationException {
  try {
    Env env=new EnvBuilder().build();
    TIntIntMap data=new TIntIntHashMap();
    Configurator configurator=env.getConfigurator();
    LocalPageDao pdao=configurator.get(LocalPageDao.class,"String_Node_Str");
    BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(f),"String_Node_Str"));
    String curLine;
    System.out.println("String_Node_Str");
    double start=System.currentTimeMillis();
    while ((curLine=br.readLine()) != null) {
      String[] cols=curLine.split("String_Node_Str");
      if (cols[0].equals(lang.getLangCode())) {
        try {
          String title=URLDecoder.decode(cols[1],"String_Node_Str");
          int pageId=pdao.getIdByTitle(new Title(title,lang));
          int numPageViews=Integer.parseInt(cols[2]);
          data.adjustOrPutValue(pageId,numPageViews,numPageViews);
        }
 catch (        IllegalArgumentException e) {
          System.out.println("String_Node_Str" + curLine);
        }
catch (        DaoException de) {
          System.out.println("String_Node_Str" + curLine);
          System.out.println(de.getMessage());
        }
      }
    }
    br.close();
    return data;
  }
 catch (  IOException e) {
    throw new WikapidiaException(e);
  }
}

Fixed version (ground truth):
private static TIntIntMap parsePageViewDataFromFile(Language lang,File f) throws WikapidiaException, DaoException, ConfigurationException {
  try {
    Env env=new EnvBuilder().build();
    TIntIntMap data=new TIntIntHashMap();
    Configurator configurator=env.getConfigurator();
    LocalPageDao pdao=configurator.get(LocalPageDao.class,"String_Node_Str");
    BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(f),"String_Node_Str"));
    String curLine;
    System.out.println("String_Node_Str");
    while ((curLine=br.readLine()) != null) {
      String[] cols=curLine.split("String_Node_Str");
      if (cols[0].equals(lang.getLangCode())) {
        try {
          String title=URLDecoder.decode(cols[1],"String_Node_Str");
          int pageId=pdao.getIdByTitle(new Title(title,lang));
          int numPageViews=Integer.parseInt(cols[2]);
          data.adjustOrPutValue(pageId,numPageViews,numPageViews);
        }
 catch (        IllegalArgumentException e) {
          System.out.println("String_Node_Str" + curLine);
        }
catch (        DaoException de) {
          System.out.println("String_Node_Str" + curLine);
          System.out.println(de.getMessage());
        }
      }
    }
    br.close();
    return data;
  }
 catch (  IOException e) {
    throw new WikapidiaException(e);
  }
}
Program: 52984
Project: 52984
Buggy source:
public static void main(String[] args) throws WikapidiaException, DaoException, ConfigurationException {
  Language lang=Language.getByLangCode("String_Node_Str");
  Env env=new EnvBuilder().build();
  Configurator configurator=env.getConfigurator();
  LocalPageDao pdao=configurator.get(LocalPageDao.class,"String_Node_Str");
  PageViewIterator it=new PageViewIterator(lang,2013,12,8,1,2013,12,8,3);
  int i=0;
  while (i < 2) {
    double start=System.currentTimeMillis();
    PageViewDataStruct data=it.next();
    double elapsed=(System.currentTimeMillis() - start) / 1000;
    System.out.println("String_Node_Str" + elapsed + "String_Node_Str"+ i);
    TIntIntMap stats=data.getPageViewStats();
    for (    int pageId : stats.keys()) {
      try {
        Title page=pdao.getById(lang,pageId).getTitle();
        System.out.println("String_Node_Str" + page + "String_Node_Str"+ stats.get(pageId));
      }
 catch (      NullPointerException e) {
        System.out.println("String_Node_Str" + e.getMessage());
        e.printStackTrace();
        continue;
      }
    }
    i++;
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws WikapidiaException, DaoException, ConfigurationException {
  Language lang=Language.getByLangCode("String_Node_Str");
  Env env=new EnvBuilder().build();
  Configurator configurator=env.getConfigurator();
  LocalPageDao pdao=configurator.get(LocalPageDao.class,"String_Node_Str");
  PageViewIterator it=new PageViewIterator(lang,2013,12,8,1,2013,12,8,5);
  int i=0;
  while (it.hasNext()) {
    double start=System.currentTimeMillis();
    PageViewDataStruct data=it.next();
    double elapsed=(System.currentTimeMillis() - start) / 1000;
    System.out.println("String_Node_Str" + elapsed + "String_Node_Str"+ i);
    TIntIntMap stats=data.getPageViewStats();
    for (    int pageId : stats.keys()) {
      try {
        Title page=pdao.getById(lang,pageId).getTitle();
        System.out.println("String_Node_Str" + page + "String_Node_Str"+ stats.get(pageId));
      }
 catch (      NullPointerException e) {
        System.out.println("String_Node_Str" + e.getMessage());
        e.printStackTrace();
        continue;
      }
    }
    i++;
  }
}
Program: 52985
Project: 52985
Buggy source:
public static void main(String[] args) throws WikapidiaException, DaoException {
  Language lang=Language.getByLangCode("String_Node_Str");
  LocalPageLiveDao pdao=new LocalPageLiveDao();
  PageViewIterator it=new PageViewIterator(lang,2013,12,8,1,2013,12,8,2);
  int i=0;
  while (i < 2) {
    double start=System.currentTimeMillis();
    PageViewDataStruct data=it.next();
    double elapsed=(System.currentTimeMillis() - start) / 1000;
    System.out.println("String_Node_Str" + elapsed + "String_Node_Str"+ i);
    TIntIntMap stats=data.getPageViewStats();
    for (    int pageId : stats.keys()) {
      Title page=pdao.getById(lang,pageId).getTitle();
      System.out.println("String_Node_Str" + page + "String_Node_Str"+ stats.get(pageId));
    }
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws WikapidiaException, DaoException {
  Language lang=Language.getByLangCode("String_Node_Str");
  LocalPageLiveDao pdao=new LocalPageLiveDao();
  PageViewIterator it=new PageViewIterator(lang,2013,12,8,1,2013,12,8,3);
  int i=0;
  while (i < 2) {
    double start=System.currentTimeMillis();
    PageViewDataStruct data=it.next();
    double elapsed=(System.currentTimeMillis() - start) / 1000;
    System.out.println("String_Node_Str" + elapsed + "String_Node_Str"+ i);
    TIntIntMap stats=data.getPageViewStats();
    for (    int pageId : stats.keys()) {
      Title page=pdao.getById(lang,pageId).getTitle();
      System.out.println("String_Node_Str" + page + "String_Node_Str"+ stats.get(pageId));
    }
    i++;
  }
}
Program: 52986
Project: 52986
Buggy source:
public static void main(String args[]) throws ConfigurationException, DaoException, IOException {
  LocalLinkDao ldao=new Configurator(new Configuration()).get(LocalLinkDao.class,"String_Node_Str");
  Language lang=Language.getByLangCode("String_Node_Str");
  int sourceId=5079506;
  int destId=454136;
  LocalLink link=ldao.getLink(lang,sourceId,destId);
  System.out.println("String_Node_Str" + link.getAnchorText() + "String_Node_Str"+ sourceId+ "String_Node_Str"+ destId);
  Iterable<LocalLink> inlinks=ldao.getLinks(lang,sourceId,false);
  System.out.println("String_Node_Str" + sourceId + "String_Node_Str");
  for (  LocalLink inlink : inlinks) {
    System.out.println("String_Node_Str" + inlink.getAnchorText() + "String_Node_Str"+ inlink.getDestId());
  }
  Iterable<LocalLink> outlinks=ldao.getLinks(lang,sourceId,true);
  System.out.println("String_Node_Str" + sourceId + "String_Node_Str");
  for (  LocalLink outlink : outlinks) {
    System.out.println("String_Node_Str" + outlink.getAnchorText() + "String_Node_Str"+ outlink.getDestId());
  }
}

Fixed version (ground truth):
public static void main(String args[]) throws ConfigurationException, DaoException, IOException {
  LocalLinkDao ldao=new Configurator(new Configuration()).get(LocalLinkDao.class,"String_Node_Str");
  Language lang=Language.getByLangCode("String_Node_Str");
  int sourceId=5079506;
  int destId=454136;
  LocalLink link=ldao.getLink(lang,sourceId,destId);
  System.out.println("String_Node_Str" + link.getAnchorText() + "String_Node_Str"+ sourceId+ "String_Node_Str"+ destId);
  Iterable<LocalLink> inlinks=ldao.getLinks(lang,sourceId,false);
  System.out.println("String_Node_Str" + sourceId + "String_Node_Str");
  for (  LocalLink inlink : inlinks) {
    System.out.println("String_Node_Str" + inlink.getAnchorText() + "String_Node_Str"+ inlink.getSourceId());
  }
  Iterable<LocalLink> outlinks=ldao.getLinks(lang,sourceId,true);
  System.out.println("String_Node_Str" + sourceId + "String_Node_Str");
  for (  LocalLink outlink : outlinks) {
    System.out.println("String_Node_Str" + outlink.getAnchorText() + "String_Node_Str"+ outlink.getDestId());
  }
}
Program: 52987
Project: 52987
Buggy source:
public Iterable<LocalLink> getLinks(Language language,int localId,boolean outlinks) throws DaoException {
  List<LocalLink> links=new ArrayList<LocalLink>();
  LiveAPIQuery.LiveAPIQueryBuilder builder;
  if (outlinks) {
    builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  }
 else {
    builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  }
  builder.setPageid(localId);
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    LocalLink link=reply.getLocalLink(language,localId,outlinks);
    links.add(link);
  }
  return links;
}

Fixed version (ground truth):
public Iterable<LocalLink> getLinks(Language language,int localId,boolean outlinks) throws DaoException {
  List<LocalLink> links=new ArrayList<LocalLink>();
  LiveAPIQuery.LiveAPIQueryBuilder builder;
  if (outlinks) {
    builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  }
 else {
    builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  }
  builder.setPageid(localId);
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    LocalLink link=outlinks ? reply.getLocalOutLink(language,localId) : reply.getLocalInLink(language,localId);
    links.add(link);
  }
  return links;
}
Program: 52988
Project: 52988
Buggy source:
public LocalLink getLink(Language language,int sourceId,int destId) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  builder.setPageid(sourceId);
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    int pageId=reply.pageId;
    if (pageId == destId) {
      return reply.getLocalLink(language,sourceId,true);
    }
  }
  throw new DaoException("String_Node_Str");
}

Fixed version (ground truth):
public LocalLink getLink(Language language,int sourceId,int destId) throws DaoException {
  LiveAPIQuery.LiveAPIQueryBuilder builder=new LiveAPIQuery.LiveAPIQueryBuilder("String_Node_Str",language);
  builder.setPageid(sourceId);
  LiveAPIQuery query=builder.build();
  List<QueryReply> replyObjects=query.getValuesFromQueryResult();
  for (  QueryReply reply : replyObjects) {
    int pageId=reply.pageId;
    if (pageId == destId) {
      return reply.getLocalOutLink(language,sourceId);
    }
  }
  throw new DaoException("String_Node_Str");
}
Program: 52989
Project: 52989
Buggy source:
private static List<String> csv2List(String csv){
  if (csv.length() > 0) {
    return Arrays.asList(csv.split("String_Node_Str"));
  }
 else {
    return new ArrayList<String>();
  }
}

Fixed version (ground truth):
private static List<String> csv2List(String csv){
  if (csv.length() > 0) {
    if (csv.charAt(0) == '"' && csv.charAt(csv.length() - 1) == '"') {
      csv=csv.substring(1,csv.length() - 1);
    }
    return Arrays.asList(csv.split("String_Node_Str"));
  }
 else {
    return new ArrayList<String>();
  }
}
Program: 52990
Project: 52990
Buggy source:
public static void main(String args[]) throws IOException, InterruptedException {
  run(LuceneLoader.class,args);
  run(ConceptLoader.class,ArrayUtils.add(args,"String_Node_Str"));
  run(UniversalLinkLoader.class,ArrayUtils.add(args,"String_Node_Str"));
  run(PhraseLoader.class,ArrayUtils.addAll(args,"String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public static void main(String args[]) throws IOException, InterruptedException {
  run(RequestedLinkGetter.class,args);
  run(FileDownloader.class,args);
  run(DumpLoader.class,ArrayUtils.addAll(args,"String_Node_Str"));
  run(RedirectLoader.class,ArrayUtils.add(args,"String_Node_Str"));
  run(WikiTextLoader.class,ArrayUtils.add(args,"String_Node_Str"));
  run(LuceneLoader.class,args);
  run(ConceptLoader.class,ArrayUtils.add(args,"String_Node_Str"));
  run(UniversalLinkLoader.class,ArrayUtils.add(args,"String_Node_Str"));
  run(PhraseLoader.class,ArrayUtils.addAll(args,"String_Node_Str","String_Node_Str"));
}
Program: 52992
Project: 52992
Buggy source:
@Test public void testGetOutlinks() throws ConfigurationException, DaoException {
  UniversalLinkDao dao=new Configurator(new Configuration()).get(UniversalLinkDao.class,"String_Node_Str");
  long start=System.currentTimeMillis();
  UniversalLinkGroup links=dao.getOutlinks(0,0);
  int i=0;
  for (  UniversalLink link : links) {
    i++;
    System.out.println(i + "String_Node_Str" + link.getDestId());
  }
  long end=System.currentTimeMillis();
  long total=end - start;
  double seconds=total / 1000.0;
  System.out.println("String_Node_Str" + seconds);
  System.out.println("String_Node_Str" + total / (double)i);
}

Fixed version (ground truth):
@Test public void testGetOutlinks() throws ConfigurationException, DaoException {
  Env env=new EnvBuilder().build();
  Configurator configurator=env.getConfigurator();
  UniversalLinkDao dao=configurator.get(UniversalLinkDao.class,"String_Node_Str");
  long start=System.currentTimeMillis();
  UniversalLinkGroup links=dao.getOutlinks(0,0);
  int i=0;
  for (  UniversalLink link : links) {
    i++;
    System.out.println(i + "String_Node_Str" + link.getDestId());
  }
  long end=System.currentTimeMillis();
  long total=end - start;
  double seconds=total / 1000.0;
  System.out.println("String_Node_Str" + seconds);
  System.out.println("String_Node_Str" + total / (double)i);
}
Program: 52993
Project: 52993
Buggy source:
@Test public void benchmarkTest() throws ConfigurationException, DaoException {
  UniversalLinkDao dao=new Configurator(new Configuration()).get(UniversalLinkDao.class,"String_Node_Str");
  long start=System.currentTimeMillis();
  Iterable<UniversalLink> links=dao.get(new DaoFilter());
  int i=0;
  for (  UniversalLink link : links) {
    i++;
    if (i % 100000 == 0)     System.out.println("String_Node_Str" + i);
  }
  long end=System.currentTimeMillis();
  long total=end - start;
  double seconds=total / 1000.0;
  System.out.println("String_Node_Str" + seconds);
  System.out.println("String_Node_Str" + total / (double)i);
}

Fixed version (ground truth):
@Test public void benchmarkTest() throws ConfigurationException, DaoException {
  Env env=new EnvBuilder().build();
  Configurator configurator=env.getConfigurator();
  UniversalLinkDao dao=configurator.get(UniversalLinkDao.class,"String_Node_Str");
  long start=System.currentTimeMillis();
  Iterable<UniversalLink> links=dao.get(new DaoFilter());
  int i=0;
  for (  UniversalLink link : links) {
    i++;
    if (i % 100000 == 0)     System.out.println("String_Node_Str" + i);
  }
  long end=System.currentTimeMillis();
  long total=end - start;
  double seconds=total / 1000.0;
  System.out.println("String_Node_Str" + seconds);
  System.out.println("String_Node_Str" + total / (double)i);
}
Program: 52994
Project: 52994
Buggy source:
public static void main(String args[]) throws ConfigurationException, DaoException {
  Configurator configurator=new Configurator(new Configuration());
  UniversalPageDao pdao=configurator.get(UniversalPageDao.class);
  UniversalLinkDao ldao=configurator.get(UniversalLinkDao.class);
  LocalPageDao lpDao=configurator.get(LocalPageDao.class);
  int i=0;
  for (  UniversalPage page : (Iterable<UniversalPage>)pdao.get(new DaoFilter().setNameSpaces(NameSpace.ARTICLE))) {
    for (    LocalId lId : page.getLocalEntities()) {
      LocalPage lPage=lpDao.getById(lId.getLanguage(),lId.getId());
      System.out.println(lPage);
    }
    System.out.println();
    i++;
  }
  System.out.println("String_Node_Str" + i);
}

Fixed version (ground truth):
public static void main(String args[]) throws ConfigurationException, DaoException {
  Env env=new EnvBuilder().build();
  Configurator configurator=env.getConfigurator();
  UniversalPageDao pdao=configurator.get(UniversalPageDao.class);
  UniversalLinkDao ldao=configurator.get(UniversalLinkDao.class);
  LocalPageDao lpDao=configurator.get(LocalPageDao.class);
  int i=0;
  for (  UniversalPage page : (Iterable<UniversalPage>)pdao.get(new DaoFilter().setNameSpaces(NameSpace.ARTICLE))) {
    for (    LocalId lId : page.getLocalEntities()) {
      LocalPage lPage=lpDao.getById(lId.getLanguage(),lId.getId());
      System.out.println(lPage);
    }
    System.out.println();
    i++;
  }
  System.out.println("String_Node_Str" + i);
}
Program: 52995
Project: 52995
Buggy source:
public static void main(String args[]) throws ConfigurationException, DaoException, IOException {
  Language lang=Language.getByLangCode("String_Node_Str");
  Configurator c=new Configurator(new Configuration());
  PhraseAnalyzer pa=c.get(PhraseAnalyzer.class,"String_Node_Str");
  LocalPageDao pageDao=c.get(LocalPageDao.class);
  LocalPage page=pageDao.getByTitle(new Title("String_Node_Str",lang),NameSpace.ARTICLE);
  System.out.println("String_Node_Str" + page + "String_Node_Str");
  LinkedHashMap<String,Float> description=pa.describeLocal(lang,page,20);
  if (description == null) {
    System.out.println("String_Node_Str");
  }
 else {
    for (    String phrase : description.keySet()) {
      System.out.println("String_Node_Str" + phrase + "String_Node_Str"+ description.get(phrase));
    }
  }
}

Fixed version (ground truth):
public static void main(String args[]) throws ConfigurationException, DaoException, IOException {
  Env env=new EnvBuilder().build();
  Configurator c=env.getConfigurator();
  Language lang=Language.getByLangCode("String_Node_Str");
  PhraseAnalyzer pa=c.get(PhraseAnalyzer.class,"String_Node_Str");
  LocalPageDao pageDao=c.get(LocalPageDao.class);
  LocalPage page=pageDao.getByTitle(new Title("String_Node_Str",lang),NameSpace.ARTICLE);
  System.out.println("String_Node_Str" + page + "String_Node_Str");
  LinkedHashMap<String,Float> description=pa.describeLocal(lang,page,20);
  if (description == null) {
    System.out.println("String_Node_Str");
  }
 else {
    for (    String phrase : description.keySet()) {
      System.out.println("String_Node_Str" + phrase + "String_Node_Str"+ description.get(phrase));
    }
  }
}
Program: 52996
Project: 52996
Buggy source:
private void insertBatches() throws DaoException, SQLException, InterruptedException {
  Connection cnx=ds.getConnection();
  try {
    String[] names=new String[fields.length];
    String[] questions=new String[fields.length];
    for (int i=0; i < fields.length; i++) {
      names[i]=fields[i].getName();
      questions[i]="String_Node_Str";
    }
    String sql="String_Node_Str" + table.getName() + "String_Node_Str"+ StringUtils.join(names,"String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ StringUtils.join(questions,"String_Node_Str")+ "String_Node_Str";
    PreparedStatement statement=cnx.prepareStatement(sql);
    while (!rowBuffer.isEmpty() || !finished) {
      int batchSize=0;
      while (batchSize < BATCH_SIZE) {
        Object row[]=rowBuffer.poll(100,TimeUnit.MILLISECONDS);
        if (row == null && finished) {
          break;
        }
        if (row != null) {
          batchSize++;
          for (int i=0; i < row.length; i++) {
            statement.setObject(i + 1,row[i]);
          }
          statement.addBatch();
        }
      }
      try {
        statement.executeBatch();
      }
 catch (      SQLException e) {
        LOG.log(Level.SEVERE,"String_Node_Str",e);
      }
      statement.clearBatch();
    }
    cnx.commit();
  }
  finally {
    AbstractSqlDao.quietlyCloseConn(cnx);
  }
}

Fixed version (ground truth):
private void insertBatches() throws DaoException, SQLException, InterruptedException {
  Connection cnx=ds.getConnection();
  try {
    String[] names=new String[fields.length];
    String[] questions=new String[fields.length];
    for (int i=0; i < fields.length; i++) {
      names[i]=fields[i].getName();
      questions[i]="String_Node_Str";
    }
    String sql="String_Node_Str" + table.getName() + "String_Node_Str"+ StringUtils.join(names,"String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ StringUtils.join(questions,"String_Node_Str")+ "String_Node_Str";
    PreparedStatement statement=cnx.prepareStatement(sql);
    while (!(rowBuffer.isEmpty() && finished)) {
      int batchSize=0;
      while (batchSize < BATCH_SIZE) {
        Object row[]=rowBuffer.poll(100,TimeUnit.MILLISECONDS);
        if (row == null && finished) {
          break;
        }
        if (row != null) {
          batchSize++;
          for (int i=0; i < row.length; i++) {
            statement.setObject(i + 1,row[i]);
          }
          statement.addBatch();
        }
      }
      try {
        statement.executeBatch();
      }
 catch (      SQLException e) {
        LOG.log(Level.SEVERE,"String_Node_Str",e);
      }
      statement.clearBatch();
    }
    cnx.commit();
  }
  finally {
    AbstractSqlDao.quietlyCloseConn(cnx);
  }
}
Program: 52997
Project: 52997
Buggy source:
public void load(Object[] values) throws DaoException {
  if (inserter == null) {
    System.exit(1);
    throw new IllegalStateException("String_Node_Str");
  }
  if (values.length != fields.length) {
    throw new IllegalArgumentException();
  }
  try {
    rowBuffer.put(values);
  }
 catch (  InterruptedException e) {
    throw new DaoException(e);
  }
}

Fixed version (ground truth):
public void load(Object[] values) throws DaoException {
  if (inserter == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (values.length != fields.length) {
    throw new IllegalArgumentException();
  }
  try {
    rowBuffer.put(values);
  }
 catch (  InterruptedException e) {
    throw new DaoException(e);
  }
}
Program: 52998
Project: 52998
Buggy source:
public void endLoad() throws DaoException {
  finished=true;
  if (inserter != null) {
    try {
      inserter.join(10000);
    }
 catch (    InterruptedException e) {
      throw new DaoException(e);
    }
  }
}

Fixed version (ground truth):
public void endLoad() throws DaoException {
  finished=true;
  if (inserter != null) {
    try {
      inserter.join(60000);
    }
 catch (    InterruptedException e) {
      throw new DaoException(e);
    }
  }
}
Program: 53000
Project: 53000
Buggy source:
private void fillBuffer(){
  if (buffer.size() > 0) {
    return;
  }
  if (reader == null) {
    return;
  }
  while (buffer.isEmpty()) {
    try {
      String line=reader.readLine();
      if (line == null) {
        reader=null;
        return;
      }
      buffer.addAll(parse(line));
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
catch (    StandardException e) {
      LOG.log(Level.SEVERE,"String_Node_Str" + line + "String_Node_Str"+ path+ "String_Node_Str",e);
      System.exit(1);
    }
    line++;
  }
}

Fixed version (ground truth):
private void fillBuffer(){
  if (buffer.size() > 0) {
    return;
  }
  if (reader == null) {
    return;
  }
  while (buffer.isEmpty()) {
    try {
      String line=reader.readLine();
      if (line == null) {
        reader=null;
        return;
      }
      buffer.addAll(parse(line));
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
catch (    StandardException e) {
      LOG.log(Level.SEVERE,"String_Node_Str" + line + "String_Node_Str"+ path+ "String_Node_Str",e);
    }
    line++;
  }
}
Program: 53001
Project: 53001
Buggy source:
public synchronized void parse(List<ParserVisitor> visitors) throws DaoException {
  DaoFilter daoFilter=new DaoFilter().setLanguages(language.getLanguage());
  try {
    createWorkers(visitors);
    for (    RawPage page : rawPageDao.get(daoFilter)) {
      try {
        queue.put(page);
      }
 catch (      InterruptedException e) {
        LOG.log(Level.WARNING,"String_Node_Str",e);
        break;
      }
    }
  }
  finally {
    cleanupWorkers();
  }
}

Fixed version (ground truth):
public synchronized void parse(List<ParserVisitor> visitors) throws DaoException {
  DaoFilter daoFilter=new DaoFilter().setLanguages(language.getLanguage());
  ParallelForEach.iterate(rawPageDao.get(daoFilter).iterator(),maxThreads,MAX_QUEUE,new ParserProcedure(visitors),10000);
}
Program: 53003
Project: 53003
Buggy source:
/** 
 * Removes any existing backups and creates backups of all stages of the pipeline.
 * @throws Exception
 */
public void createBackups() throws Exception {
  createWikiText();
}

Fixed version (ground truth):
/** 
 * Removes any existing backups and creates backups of all stages of the pipeline.
 * @throws Exception
 */
public void createBackups() throws Exception {
  createLucene();
}
Program: 53004
Project: 53004
Buggy source:
private void createLucene() throws DaoException, WikapidiaException, ConfigurationException, IOException, SQLException {
  deleteH2Backup("String_Node_Str");
  LuceneLoader.main(TestUtils.getArgs());
  backupH2To("String_Node_Str");
}

Fixed version (ground truth):
private void createLucene() throws DaoException, WikapidiaException, ConfigurationException, IOException, SQLException {
  File luceneDir=new File(env.getConfiguration().get().getString("String_Node_Str"));
  deleteH2Backup("String_Node_Str");
  FileUtils.deleteQuietly(luceneDir);
  LuceneLoader.main(TestUtils.getArgs());
  ZipDir.zip(luceneDir,new File(dir,"String_Node_Str"));
  backupH2To("String_Node_Str");
}
Program: 53005
Project: 53005
Buggy source:
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();
  }
}

Fixed version (ground truth):
private void cleanupWorkers(){
  long maxMillis=System.currentTimeMillis() + 2 * 60 * 1000;
  for (  Thread w : workers) {
    try {
      w.join(Math.max(0,maxMillis - System.currentTimeMillis()));
    }
 catch (    InterruptedException e) {
      LOG.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  for (  Thread w : workers) {
    w.interrupt();
  }
  workers.clear();
}
Program: 53006
Project: 53006
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).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();
  }
}

Fixed version (ground truth):
/** 
 * NOTE: only one language can be loaded at a time.
 * @param language
 * @throws WikapidiaException
 */
public synchronized void load(Language language) throws WikapidiaException, ConfigurationException {
  try {
    createWorkers();
    DaoFilter filter=new DaoFilter().setLanguages(language).setNameSpaces(namespaces).setRedirect(false);
    int n=rawPageDao.getCount(filter);
    int i=0;
    luceneIndexer=new LuceneIndexer(language,luceneOptions);
    for (    RawPage rawPage : rawPageDao.get(filter)) {
      queue.put(rawPage);
      if (++i % 1000 == 0) {
        LOG.log(Level.INFO,"String_Node_Str" + language + "String_Node_Str"+ i+ "String_Node_Str"+ n);
      }
    }
    queue.put(POISON_PILL);
  }
 catch (  DaoException e) {
    throw new WikapidiaException(e);
  }
catch (  InterruptedException e) {
    throw new WikapidiaException(e);
  }
 finally {
    cleanupWorkers();
    queue.clear();
    if (luceneIndexer != null) {
      IOUtils.closeQuietly(luceneIndexer);
      luceneIndexer=null;
    }
  }
}
Program: 53007
Project: 53007
Buggy source:
@Override public void run(){
  boolean finished=false;
  while (!finished) {
    RawPage rp=null;
    Language lang=null;
    try {
      rp=queue.poll(100,TimeUnit.MILLISECONDS);
      if (rp != null) {
        lang=rp.getLanguage();
        if (rp.getLocalId() == -2) {
          queue.put(rp);
          finished=true;
        }
 else {
          luceneIndexer.indexPage(rp);
          metaDao.incrementRecords(LuceneSearcher.class,lang);
        }
      }
    }
 catch (    InterruptedException e) {
      LOG.log(Level.WARNING,"String_Node_Str");
      return;
    }
catch (    Exception e) {
      metaDao.incrementErrorsQuietly(LuceneSearcher.class,lang);
      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(){
  boolean finished=false;
  while (!finished) {
    RawPage rp=null;
    Language lang=null;
    try {
      rp=queue.poll(100,TimeUnit.MILLISECONDS);
      if (rp == POISON_PILL) {
        queue.put(rp);
        finished=true;
      }
 else       if (rp != null) {
        luceneIndexer.indexPage(rp);
        metaDao.incrementRecords(LuceneSearcher.class,lang);
      }
    }
 catch (    InterruptedException e) {
      LOG.log(Level.WARNING,"String_Node_Str");
      return;
    }
catch (    Exception e) {
      metaDao.incrementErrorsQuietly(LuceneSearcher.class,lang);
      String title="String_Node_Str";
      if (rp != null)       title=rp.getTitle().toString();
      LOG.log(Level.WARNING,"String_Node_Str" + title,e);
    }
  }
}
Program: 53009
Project: 53009
Buggy source:
public void endLoad(){
  luceneIndexer.close();
}

Fixed version (ground truth):
public void endLoad(){
  if (luceneIndexer != null) {
    luceneIndexer.close();
  }
}
Program: 53010
Project: 53010
Buggy source:
public LuceneLoader(RawPageDao rawPageDao,MetaInfoDao metaDao,LuceneIndexer luceneIndexer,Collection<NameSpace> namespaces){
  this.rawPageDao=rawPageDao;
  this.metaDao=metaDao;
  this.luceneIndexer=luceneIndexer;
  this.namespaces=namespaces;
}

Fixed version (ground truth):
public LuceneLoader(RawPageDao rawPageDao,MetaInfoDao metaDao,LuceneOptions[] luceneOptions,Collection<NameSpace> namespaces){
  this.rawPageDao=rawPageDao;
  this.metaDao=metaDao;
  this.luceneOptions=luceneOptions;
  this.namespaces=namespaces;
}
Program: 53011
Project: 53011
Buggy source:
private LuceneIndexer(LanguageSet languages,File root,LuceneOptions... options) throws ConfigurationException {
  try {
    this.root=root;
    writers=new HashMap<Language,IndexWriter>();
    this.options=options;
    this.mainOptions=options[0];
    this.builder=new TextFieldBuilder(mainOptions.configurator.get(LocalPageDao.class),mainOptions.configurator.get(RawPageDao.class),mainOptions.configurator.get(RedirectDao.class));
    for (    Language language : languages) {
      File langRoot=new File(root,language.getLangCode());
      if (langRoot.exists()) {
        FileUtils.deleteQuietly(langRoot);
      }
      WikapidiaAnalyzer analyzer=new WikapidiaAnalyzer(language,mainOptions);
      Directory directory=FSDirectory.open(langRoot);
      IndexWriterConfig iwc=new IndexWriterConfig(mainOptions.matchVersion,analyzer);
      writers.put(language,new IndexWriter(directory,iwc));
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private LuceneIndexer(Language language,File root,LuceneOptions... options) throws ConfigurationException {
  try {
    this.root=root;
    this.language=language;
    this.options=options;
    this.mainOptions=options[0];
    this.builder=new TextFieldBuilder(mainOptions.configurator.get(LocalPageDao.class),mainOptions.configurator.get(RawPageDao.class),mainOptions.configurator.get(RedirectDao.class));
    File langRoot=new File(root,language.getLangCode());
    if (langRoot.exists()) {
      FileUtils.deleteQuietly(langRoot);
    }
    WikapidiaAnalyzer analyzer=new WikapidiaAnalyzer(language,mainOptions);
    Directory directory=FSDirectory.open(langRoot);
    IndexWriterConfig iwc=new IndexWriterConfig(mainOptions.matchVersion,analyzer);
    writer=new IndexWriter(directory,iwc);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}