nus-yam/ex-repair huggingface dataset:
Program: 52888
Project: 52888
Buggy source:
@Override public Map<String,MetaInfo> getAllCummulativeInfo() throws DaoException {
  sync();
  DSLContext context=getJooq();
  try {
    Result<Record> result=context.select().from(Tables.META_INFO).fetch();
    Map<String,MetaInfo> components=new HashMap<String,MetaInfo>();
    for (    Record record : result) {
      String className=record.getValue(Tables.META_INFO.COMPONENT);
      Class klass=JvmUtils.classForShortName(className);
      if (klass == null) {
        throw new DaoException("String_Node_Str" + className);
      }
      if (!components.containsKey(className)) {
        components.put(className,new MetaInfo(klass));
      }
      Short langId=record.getValue(Tables.META_INFO.LANG_ID);
      components.get(className).merge(new MetaInfo(klass,(langId == null) ? null : Language.getById(langId),record.getValue(Tables.META_INFO.ID),record.getValue(Tables.META_INFO.NUM_RECORDS),record.getValue(Tables.META_INFO.NUM_ERRORS),record.getValue(Tables.META_INFO.LAST_UPDATED)));
    }
    return components;
  }
  finally {
    freeJooq(context);
  }
}

Fixed version (ground truth):
@Override public Map<String,MetaInfo> getAllCummulativeInfo() throws DaoException {
  sync();
  DSLContext context=getJooq();
  try {
    Map<String,MetaInfo> components=new HashMap<String,MetaInfo>();
    if (!tableExists(context)) {
      return components;
    }
    Result<Record> result=context.select().from(Tables.META_INFO).fetch();
    for (    Record record : result) {
      String className=record.getValue(Tables.META_INFO.COMPONENT);
      Class klass=JvmUtils.classForShortName(className);
      if (klass == null) {
        throw new DaoException("String_Node_Str" + className);
      }
      if (!components.containsKey(className)) {
        components.put(className,new MetaInfo(klass));
      }
      Short langId=record.getValue(Tables.META_INFO.LANG_ID);
      components.get(className).merge(new MetaInfo(klass,(langId == null) ? null : Language.getById(langId),record.getValue(Tables.META_INFO.ID),record.getValue(Tables.META_INFO.NUM_RECORDS),record.getValue(Tables.META_INFO.NUM_ERRORS),record.getValue(Tables.META_INFO.LAST_UPDATED)));
    }
    return components;
  }
  finally {
    freeJooq(context);
  }
}
Program: 52890
Project: 52890
Buggy source:
@Override public void call(String country) throws Exception {
  countInc();
  List<SimpleFeature> features=inputFeatureHandler(inputCollection,country,0,WIKITYPE,countryState);
  writeQueue.push(features);
  writeToShpFile(outputFeatureSource,WIKITYPE,transaction,writeQueue.pop());
  ;
}

Fixed version (ground truth):
@Override public void call(String country) throws Exception {
  countInc();
  List<SimpleFeature> features=inputFeatureHandler(inputCollection,country,0,WIKITYPE,countryState);
  writeQueue.add(features);
  writeToShpFile(outputFeatureSource,WIKITYPE,transaction,writeQueue.poll());
  ;
}
Program: 52892
Project: 52892
Buggy source:
public static void downloadAndConvert(SpatialDataFolder folder) throws WikiBrainException {
  try {
    WpIOUtils ioUtils=new WpIOUtils();
    String tmpFolderName="String_Node_Str";
    File tmpFolder=WpIOUtils.createTempDirectory(tmpFolderName,true);
    File rawFile=downloadGADMShapeFile(tmpFolder.getCanonicalPath());
    LOG.log(Level.INFO,"String_Node_Str" + folder.getRefSysFolder("String_Node_Str").getCanonicalPath());
    FileUtils.copyDirectory(new File(tmpFolder.getCanonicalPath()),folder.getRefSysFolder("String_Node_Str"));
    LOG.log(Level.INFO,"String_Node_Str");
    convertShpFile(rawFile,folder,1);
    LOG.log(Level.INFO,"String_Node_Str");
    convertShpFile(rawFile,folder,0);
  }
 catch (  IOException e) {
    throw new WikiBrainException(e);
  }
catch (  ZipException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void downloadAndConvert(SpatialDataFolder folder) throws WikiBrainException {
  try {
    WpIOUtils ioUtils=new WpIOUtils();
    String tmpFolderName="String_Node_Str";
    File tmpFolder=WpIOUtils.createTempDirectory(tmpFolderName,true);
    File rawFile=new File("String_Node_Str");
    LOG.log(Level.INFO,"String_Node_Str" + folder.getRefSysFolder("String_Node_Str").getCanonicalPath());
    LOG.log(Level.INFO,"String_Node_Str");
    convertShpFile(folder,1);
    LOG.log(Level.INFO,"String_Node_Str");
    convertShpFile(folder,0);
  }
 catch (  IOException e) {
    throw new WikiBrainException(e);
  }
}
Program: 52893
Project: 52893
Buggy source:
/** 
 * Download GADM shape file
 * @param tmpFolder
 * @return
 */
public static File downloadGADMShapeFile(String tmpFolder) throws IOException, ZipException, InterruptedException {
  String baseFileName="String_Node_Str";
  String zipFileName=baseFileName + "String_Node_Str";
  String gadmURL="String_Node_Str" + zipFileName;
  File gadmShapeFile=new File(tmpFolder + "String_Node_Str" + zipFileName);
  FileDownloader downloader=new FileDownloader();
  downloader.download(new URL(gadmURL),gadmShapeFile);
  ZipFile zipFile=new ZipFile(gadmShapeFile.getCanonicalPath());
  LOG.log(Level.INFO,"String_Node_Str" + gadmShapeFile.getParent());
  zipFile.extractAll(gadmShapeFile.getParent());
  File f=new File(tmpFolder + "String_Node_Str");
  LOG.log(Level.INFO,"String_Node_Str");
  gadmShapeFile.delete();
  return f;
}

Fixed version (ground truth):
/** 
 * Download GADM shape file
 * @param tmpFolder
 * @return
 */
public File downloadGADMShapeFile(String tmpFolder) throws IOException, ZipException, InterruptedException {
  String baseFileName="String_Node_Str";
  String zipFileName=baseFileName + "String_Node_Str";
  String gadmURL="String_Node_Str" + zipFileName;
  File gadmShapeFile=new File(tmpFolder + "String_Node_Str" + zipFileName);
  FileDownloader downloader=new FileDownloader();
  downloader.download(new URL(gadmURL),gadmShapeFile);
  ZipFile zipFile=new ZipFile(gadmShapeFile.getCanonicalPath());
  LOG.log(Level.INFO,"String_Node_Str" + gadmShapeFile.getParent());
  zipFile.extractAll(gadmShapeFile.getParent());
  File f=new File(tmpFolder + "String_Node_Str");
  LOG.log(Level.INFO,"String_Node_Str");
  gadmShapeFile.delete();
  return f;
}
Program: 52896
Project: 52896
Buggy source:
@Override protected boolean storeStatement(WikidataStatement statement) throws DaoException {
  int itemId=statement.getItem().getId();
  Geometry g=EarthBasicCoordinatesWikidataLayerLoader.jsonToGeometry(statement.getValue().getJsonValue().getAsJsonObject());
  if (g != null) {
    Iterable<WikidataStatement> instanceOfStatements=wdDao.get((new WikidataFilter.Builder()).withPropertyId(INSTANCE_OF_PROPERTY_ID).withEntityId(itemId).build());
    int count=0;
    for (    WikidataStatement instanceOfStatement : instanceOfStatements) {
      int typeItemId=instanceOfStatement.getValue().getItemValue();
      String layerName=Integer.toString(typeItemId);
      spatialDao.saveGeometry(itemId,layerName,EARTH_REF_SYS_NAME,g);
      count++;
    }
    if (count > 0) {
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override protected boolean storeStatement(WikidataStatement statement) throws DaoException {
  int itemId=statement.getItem().getId();
  Geometry g=EarthBasicCoordinatesWikidataLayerLoader.jsonToGeometry(statement.getValue().getJsonValue().getAsJsonObject());
  if (g != null) {
    Iterable<WikidataStatement> instanceOfStatements=wdDao.get((new WikidataFilter.Builder()).withEntityId(itemId).withPropertyId(INSTANCE_OF_PROPERTY_ID).build());
    int count=0;
    for (    WikidataStatement instanceOfStatement : instanceOfStatements) {
      int typeItemId=instanceOfStatement.getValue().getItemValue();
      String layerName="String_Node_Str" + Integer.toString(typeItemId);
      spatialDao.saveGeometry(itemId,layerName,EARTH_REF_SYS_NAME,g);
      count++;
    }
    if (count > 0) {
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}
Program: 52897
Project: 52897
Buggy source:
private void loadWikidataData() throws WikiBrainException {
  try {
    spatialDataDao.beginSaveGeometries();
    List<WikidataLayerLoader> layerLoaders=Lists.newArrayList();
    layerLoaders.add(new EarthInstanceOfCoordinatesLayerLoader(wdDao,spatialDataDao));
    for (    WikidataLayerLoader layerLoader : layerLoaders) {
      LOG.log(Level.INFO,"String_Node_Str" + layerLoader.getClass().getName());
      layerLoader.loadData(langs);
    }
    spatialDataDao.endSaveGeometries();
  }
 catch (  DaoException e) {
    throw new WikiBrainException(e);
  }
}

Fixed version (ground truth):
private void loadWikidataData() throws WikiBrainException {
  try {
    spatialDataDao.beginSaveGeometries();
    List<WikidataLayerLoader> layerLoaders=Lists.newArrayList();
    layerLoaders.add(new EarthBasicCoordinatesWikidataLayerLoader(wdDao,spatialDataDao));
    for (    WikidataLayerLoader layerLoader : layerLoaders) {
      LOG.log(Level.INFO,"String_Node_Str" + layerLoader.getClass().getName());
      layerLoader.loadData(langs);
    }
    spatialDataDao.endSaveGeometries();
  }
 catch (  DaoException e) {
    throw new WikiBrainException(e);
  }
}
Program: 52898
Project: 52898
Buggy source:
private void initWord2Vec(String name) throws ConfigurationException, IOException, DaoException {
  Config config=getMetricConfig(name).getConfig("String_Node_Str");
  String corpusName=config.getString("String_Node_Str");
  Corpus corpus=null;
  if (!corpusName.equals("String_Node_Str")) {
    corpus=env.getConfigurator().get(Corpus.class,config.getString("String_Node_Str"),"String_Node_Str",language.getLangCode());
    if (!corpus.exists()) {
      corpus.create();
    }
  }
  File model=Word2VecGenerator.getModelFile(config.getString("String_Node_Str"),language);
  if (!model.isFile()) {
    if (corpus == null) {
      throw new ConfigurationException("String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str"+ model+ "String_Node_Str");
    }
    Word2VecTrainer trainer=new Word2VecTrainer(env.getConfigurator().get(LocalPageDao.class),language);
    trainer.train(corpus.getDirectory());
    trainer.save(model);
  }
  LinkProbabilityDao lpd=env.getConfigurator().get(LinkProbabilityDao.class);
  if (!lpd.isBuilt()) {
    lpd.build();
  }
}

Fixed version (ground truth):
private void initWord2Vec(String name) throws ConfigurationException, IOException, DaoException {
  LinkProbabilityDao lpd=env.getConfigurator().get(LinkProbabilityDao.class);
  if (!lpd.isBuilt()) {
    lpd.build();
  }
  Config config=getMetricConfig(name).getConfig("String_Node_Str");
  String corpusName=config.getString("String_Node_Str");
  Corpus corpus=null;
  if (!corpusName.equals("String_Node_Str")) {
    corpus=env.getConfigurator().get(Corpus.class,config.getString("String_Node_Str"),"String_Node_Str",language.getLangCode());
    if (!corpus.exists()) {
      corpus.create();
    }
  }
  File model=Word2VecGenerator.getModelFile(config.getString("String_Node_Str"),language);
  if (!model.isFile()) {
    if (corpus == null) {
      throw new ConfigurationException("String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str"+ model+ "String_Node_Str");
    }
    Word2VecTrainer trainer=new Word2VecTrainer(env.getConfigurator().get(LocalPageDao.class),language);
    trainer.train(corpus.getDirectory());
    trainer.save(model);
  }
}
Program: 52899
Project: 52899
Buggy source:
public boolean hasCategoryDistance(int categoryId){
  return catDistances.containsKey(graph.getCategoryIndex(categoryId));
}

Fixed version (ground truth):
public boolean hasCategoryDistance(int pageId){
  return catDistances.containsKey(graph.getCategoryIndex(pageId));
}
Program: 52902
Project: 52902
Buggy source:
/** 
 * calculate interpolated values for missing ranks and scores
 * @param examples
 */
public void trainSimilarity(List<EnsembleSim> examples){
  for (int i=0; i < numMetrics; i++) {
    int numMissingScores=0;
    double sumMissingScores=0.0;
    for (    EnsembleSim es : examples) {
      double v=es.getScores().get(i);
      if (Double.isNaN(v) || Double.isInfinite(v)) {
        sumMissingScores+=es.getKnownSim().similarity;
        numMissingScores++;
      }
    }
    missingScores[i]=(numMissingScores > 0) ? (sumMissingScores / numMissingScores) : 0.0;
    LOG.info("String_Node_Str" + i + "String_Node_Str"+ "String_Node_Str"+ missingScores[i]);
  }
}

Fixed version (ground truth):
/** 
 * calculate interpolated values for missing ranks and scores
 * @param examples
 */
public void trainSimilarity(List<EnsembleSim> examples){
  for (int i=0; i < numMetrics; i++) {
    int numMissingScores=0;
    double sumMissingScores=0.0;
    for (    EnsembleSim es : examples) {
      if (es != null) {
        double v=es.getScores().get(i);
        if (Double.isNaN(v) || Double.isInfinite(v)) {
          sumMissingScores+=es.getKnownSim().similarity;
          numMissingScores++;
        }
      }
    }
    missingScores[i]=(numMissingScores > 0) ? (sumMissingScores / numMissingScores) : 0.0;
    LOG.info("String_Node_Str" + i + "String_Node_Str"+ "String_Node_Str"+ missingScores[i]);
  }
}
Program: 52905
Project: 52905
Buggy source:
/** 
 * @param language
 * @param lpDao
 * @param lcmDao
 * @return
 * @throws DaoException
 */
public CategoryGraph build(Language language,LocalPageDao lpDao,LocalCategoryMemberDao lcmDao) throws DaoException {
  CategoryGraph graph=new CategoryGraph(language);
  loadCategories(graph,lpDao);
  buildGraph(graph,lcmDao);
  computePageRanks(graph);
  return graph;
}

Fixed version (ground truth):
/** 
 * @param language
 * @return
 * @throws DaoException
 */
public CategoryGraph build(Language language) throws DaoException {
  CategoryGraph graph=new CategoryGraph(language);
  loadCategories(graph);
  buildGraph(graph);
  computePageRanks(graph);
  return graph;
}
Program: 52906
Project: 52906
Buggy source:
private void loadCategories(CategoryGraph graph,LocalPageDao lpDao) throws DaoException {
  LOG.info("String_Node_Str");
  graph.catIndexes=new TIntIntHashMap();
  List<String> catList=new ArrayList<String>();
  Iterable<LocalPage> catIter=lpDao.get(new DaoFilter().setNameSpaces(NameSpace.CATEGORY).setLanguages(graph.language));
  for (  LocalPage cat : catIter) {
    if (cat != null) {
      catList.add(cat.getTitle().getCanonicalTitle());
      graph.catIndexes.put(cat.getLocalId(),graph.catIndexes.size());
    }
  }
  graph.cats=catList.toArray(new String[0]);
  LOG.info("String_Node_Str" + graph.cats.length + "String_Node_Str");
}

Fixed version (ground truth):
private void loadCategories(CategoryGraph graph) throws DaoException {
  LOG.info("String_Node_Str");
  graph.catIndexes=new TIntIntHashMap();
  List<String> catList=new ArrayList<String>();
  Iterable<LocalPage> catIter=pageDao.get(new DaoFilter().setNameSpaces(NameSpace.CATEGORY).setLanguages(graph.language));
  TIntList catIds=new TIntArrayList();
  for (  LocalPage cat : catIter) {
    if (cat != null) {
      if (graph.catIndexes.containsKey(cat.getLocalId())) {
        continue;
      }
      assert(catList.size() == graph.catIndexes.size());
      assert(catIds.size() == graph.catIndexes.size());
      int ci=graph.catIndexes.size();
      graph.catIndexes.put(cat.getLocalId(),ci);
      catList.add(cat.getTitle().getCanonicalTitle());
      catIds.add(cat.getLocalId());
    }
  }
  graph.cats=catList.toArray(new String[0]);
  graph.catIds=catIds.toArray();
  LOG.info("String_Node_Str" + graph.cats.length + "String_Node_Str");
}
Program: 52907
Project: 52907
Buggy source:
@Override public CategoryGraph getGraph(Language language) throws DaoException {
  String key="String_Node_Str" + language.getLangCode();
  if (cache != null) {
    CategoryGraph graph=(CategoryGraph)cache.get(key,LocalPage.class,LocalCategoryMember.class);
    if (graph != null) {
      return graph;
    }
  }
  LocalCategoryGraphBuilder builder=new LocalCategoryGraphBuilder();
  CategoryGraph graph=builder.build(language,localPageDao,this);
  cache.put(key,graph);
  return graph;
}

Fixed version (ground truth):
@Override public CategoryGraph getGraph(Language language) throws DaoException {
  String key="String_Node_Str" + language.getLangCode();
  if (cache != null) {
    CategoryGraph graph=(CategoryGraph)cache.get(key,LocalPage.class,LocalCategoryMember.class);
    if (graph != null) {
      return graph;
    }
  }
  LocalCategoryGraphBuilder builder=new LocalCategoryGraphBuilder(localPageDao,this);
  CategoryGraph graph=builder.build(language);
  cache.put(key,graph);
  return graph;
}
Program: 52908
Project: 52908
Buggy source:
public CategoryBfs(CategoryGraph graph,int startCatId,Language language,int maxResults,TIntSet validWpIds,LocalCategoryMemberDao categoryMemberDao) throws DaoException {
  this.startPage=startCatId;
  this.maxResults=maxResults;
  this.graph=graph;
  this.validWpIds=validWpIds;
  this.categoryMemberDao=categoryMemberDao;
  this.language=language;
  pageDistances.put(startPage,0.000000);
  Map<Integer,LocalCategory> cats=categoryMemberDao.getCategories(language,startCatId);
  if (cats != null) {
    for (    int catId : categoryMemberDao.getCategories(language,startCatId).keySet()) {
      int ci=graph.getCategoryIndex(catId);
      if (ci >= 0) {
        openCats.add(new CategoryDistance(ci,graph.cats[ci],graph.catCosts[ci],(byte)+1));
      }
    }
  }
}

Fixed version (ground truth):
public CategoryBfs(CategoryGraph graph,int startId,NameSpace startNamespace,Language language,int maxResults,TIntSet validWpIds,LocalCategoryMemberDao categoryMemberDao,int direction) throws DaoException {
  this.startPage=startId;
  this.maxResults=maxResults;
  this.graph=graph;
  this.validWpIds=validWpIds;
  this.categoryMemberDao=categoryMemberDao;
  this.language=language;
  pageDistances.put(startPage,0.000000);
  if (startNamespace == NameSpace.ARTICLE) {
    Map<Integer,LocalCategory> cats=categoryMemberDao.getCategories(language,startId);
    if (cats != null) {
      for (      int catId : categoryMemberDao.getCategories(language,startId).keySet()) {
        int ci=graph.getCategoryIndex(catId);
        if (ci >= 0) {
          openCats.add(new CategoryDistance(ci,graph.cats[ci],graph.catCosts[ci],(byte)direction));
        }
      }
    }
  }
 else   if (startNamespace == NameSpace.CATEGORY) {
    int ci=graph.getCategoryIndex(startId);
    if (ci >= 0) {
      openCats.add(new CategoryDistance(ci,graph.cats[ci],0.000000001,(byte)direction));
    }
  }
 else {
    throw new IllegalArgumentException();
  }
}
Program: 52909
Project: 52909
Buggy source:
public boolean hasCategoryDistance(int categoryId){
  return catDistances.containsKey(categoryId);
}

Fixed version (ground truth):
public boolean hasCategoryDistance(int categoryId){
  return catDistances.containsKey(graph.getCategoryIndex(categoryId));
}
Program: 52910
Project: 52910
Buggy source:
public double getCategoryDistance(int categoryId){
  return catDistances.get(categoryId);
}

Fixed version (ground truth):
public double getCategoryDistance(int categoryId){
  return catDistances.get(graph.getCategoryIndex(categoryId));
}
Program: 52913
Project: 52913
Buggy source:
@Override public Integer getWikidataItemIdForId(Object id) throws WikiBrainException {
  try {
    LinkedHashMap<LocalId,Float> candidate=analyzer.resolve(myLang,(String)id,1);
    if (candidate.size() == 0)     return null;
    LocalId li=candidate.keySet().iterator().next();
    return li.getId();
  }
 catch (  DaoException e) {
    throw new WikiBrainException(e);
  }
}

Fixed version (ground truth):
@Override public Integer getWikidataItemIdForId(Object id) throws WikiBrainException {
  try {
    LinkedHashMap<LocalId,Float> candidate=analyzer.resolve(myLang,(String)id,1);
    if (candidate.size() == 0)     return null;
    LocalId li=candidate.keySet().iterator().next();
    return wdDao.getItemId(li);
  }
 catch (  DaoException e) {
    throw new WikiBrainException(e);
  }
}
Program: 52914
Project: 52914
Buggy source:
/** 
 * Gets the item id for a given LocalPage (the number after "Q")
 * @param page
 * @return
 * @throws DaoException
 */
Integer getItemId(LocalPage page) throws DaoException ;

Fixed version (ground truth):
Integer getItemId(LocalId localId) throws DaoException ;
Program: 52915
Project: 52915
Buggy source:
@Override public Integer getItemId(LocalPage page) throws DaoException {
  return upDao.getUnivPageId(page,WIKIDATA_ALGORITHM_ID);
}

Fixed version (ground truth):
@Override public Integer getItemId(LocalId localId) throws DaoException {
  return upDao.getUnivPageId(localId.getLanguage(),localId.getId(),WIKIDATA_ALGORITHM_ID);
}
Program: 52916
Project: 52916
Buggy source:
private void addWikidataIlls(LocalId input,Set<LocalId> curIlls){
  if (localId2ItemIdIndex.contains(input)) {
    Integer itemId=localId2ItemIdIndex.get(input);
    curIlls.addAll(itemId2LocalIdIndex.get(itemId));
  }
}

Fixed version (ground truth):
private void addWikidataIlls(LocalId input,Set<LocalId> curIlls){
  if (localId2ItemIdIndex.contains(input)) {
    Integer itemId=localId2ItemIdIndex.get(input);
    curIlls.addAll(itemId2LocalIdIndex.get(itemId));
    curIlls.remove(input);
  }
}
Program: 52917
Project: 52917
Buggy source:
@Override public List<ClusterResult> handle(List<LocalId> curVertices,ILLGraph graph,int componentId) throws WikiBrainException {
  ConceptualignHelper.ScanResult origScanResult=ConceptualignHelper.scanVerticesOfComponent(curVertices);
  boolean origNotAmbiguous=origScanResult.clarity.equals(1.0);
  if (origNotAmbiguous) {
    List<ClusterResult> rVal=Lists.newArrayList();
    rVal.add(new ClusterResult(getCurUnivId(),curVertices));
    return rVal;
  }
  if (print)   printAmbiguousCluster(curVertices);
  Map<LocalId,List<LocalId>> ills=new HashMap<LocalId,List<LocalId>>();
  for (  LocalId curVertex : curVertices) {
    Set<ILLEdge> edges=graph.outgoingEdgesOf(curVertex);
    List<LocalId> dests=new ArrayList<LocalId>();
    for (    ILLEdge edge : edges) {
      dests.add(edge.dest);
    }
    ills.put(curVertex,dests);
  }
  List<ClusterResult> rVal=new ArrayList<ClusterResult>();
  int minLangVotes=(int)Math.floor(minVotesRatio * origScanResult.langCount);
  Set<Set<LocalId>> clusters=ILLSplitter.split(ills,minLangVotes,maxVotesPerLang,print,lpDao);
  for (  Set<LocalId> curCluster : clusters) {
    int clusterUnivId=getCurUnivId();
    List<LocalId> vertexList=new ArrayList<LocalId>();
    vertexList.addAll(curCluster);
    ClusterResult clusterResult=new ClusterResult(clusterUnivId,vertexList);
    rVal.add(clusterResult);
  }
  return rVal;
}

Fixed version (ground truth):
@Override public List<ClusterResult> handle(List<LocalId> curVertices,ILLGraph graph,int componentId) throws WikiBrainException {
  ConceptualignHelper.ScanResult origScanResult=ConceptualignHelper.scanVerticesOfComponent(curVertices);
  boolean origNotAmbiguous=origScanResult.clarity.equals(1.0);
  if (origNotAmbiguous) {
    List<ClusterResult> rVal=Lists.newArrayList();
    rVal.add(new ClusterResult(getCurUnivId(),curVertices));
    return rVal;
  }
  if (print)   printAmbiguousCluster(curVertices);
  Map<LocalId,List<LocalId>> ills=new HashMap<LocalId,List<LocalId>>();
  for (  LocalId curVertex : curVertices) {
    Set<ILLEdge> edges=graph.outgoingEdgesOf(curVertex);
    List<LocalId> dests=new ArrayList<LocalId>();
    for (    ILLEdge edge : edges) {
      dests.add(edge.dest);
    }
    ills.put(curVertex,dests);
  }
  List<ClusterResult> rVal=new ArrayList<ClusterResult>();
  int minLangVotes=(int)Math.floor(minVotesRatio * origScanResult.langCount - 1);
  Set<Set<LocalId>> clusters=ILLSplitter.split(ills,minLangVotes,maxVotesPerLang,print,lpDao);
  for (  Set<LocalId> curCluster : clusters) {
    int clusterUnivId=getCurUnivId();
    List<LocalId> vertexList=new ArrayList<LocalId>();
    vertexList.addAll(curCluster);
    ClusterResult clusterResult=new ClusterResult(clusterUnivId,vertexList);
    rVal.add(clusterResult);
  }
  return rVal;
}
Program: 52918
Project: 52918
Buggy source:
@Override public Iterator<UniversalPage> getConceptMap(LanguageSet ls) throws WikiBrainException, DaoException {
  int maxEdge=2;
  double minLang=0.5;
  if (uPages == null) {
    LOG.log(Level.INFO,"String_Node_Str");
    Iterator<UniversalPage> uPages=wdMapper.getConceptMap(ls);
  }
 else {
    if (!ls.equals(uPageLs)) {
      throw new WikiBrainException("String_Node_Str");
    }
  }
  CombinedIllDao combinedDao=new CombinedIllDao(uPages.iterator(),illDao);
  ILLGraph illGraph=new ILLGraph(combinedDao,localPageDao,miDao);
  BreadthFirstIterator<LocalId,ILLEdge> bfi=new BreadthFirstIterator<LocalId,ILLEdge>(illGraph);
  List<ConnectedComponentHandler> ccHandlers=new ArrayList<ConnectedComponentHandler>();
  ccHandlers.add(new Conceptualign3ConnectedComponentHandler(minLang,maxEdge,true,this.localPageDao));
  ConnectedComponentTraversalListener listener=new ConnectedComponentTraversalListener(illGraph,ccHandlers);
  bfi.addTraversalListener(listener);
  while (bfi.hasNext()) {
    LocalId localId=bfi.next();
  }
  return new MapperIterator<UniversalPage>(listener.getClusterResults()){
    @Override public UniversalPage transform(    Object obj){
      ClusterResult curCluster=(ClusterResult)obj;
      return new UniversalPage(curCluster.univId,getId(),NameSpace.ARTICLE,curCluster.vertices);
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<UniversalPage> getConceptMap(LanguageSet ls) throws WikiBrainException, DaoException {
  int maxEdge=2;
  double minLang=1.0;
  if (uPages == null) {
    LOG.log(Level.INFO,"String_Node_Str");
    Iterator<UniversalPage> uPages=wdMapper.getConceptMap(ls);
  }
 else {
    if (!ls.equals(uPageLs)) {
      throw new WikiBrainException("String_Node_Str");
    }
  }
  CombinedIllDao combinedDao=new CombinedIllDao(uPages.iterator(),illDao);
  ILLGraph illGraph=new ILLGraph(combinedDao,localPageDao,miDao);
  BreadthFirstIterator<LocalId,ILLEdge> bfi=new BreadthFirstIterator<LocalId,ILLEdge>(illGraph);
  List<ConnectedComponentHandler> ccHandlers=new ArrayList<ConnectedComponentHandler>();
  ccHandlers.add(new Conceptualign3ConnectedComponentHandler(minLang,maxEdge,true,this.localPageDao));
  ConnectedComponentTraversalListener listener=new ConnectedComponentTraversalListener(illGraph,ccHandlers);
  bfi.addTraversalListener(listener);
  while (bfi.hasNext()) {
    LocalId localId=bfi.next();
  }
  return new MapperIterator<UniversalPage>(listener.getClusterResults()){
    @Override public UniversalPage transform(    Object obj){
      ClusterResult curCluster=(ClusterResult)obj;
      return new UniversalPage(curCluster.univId,getId(),NameSpace.ARTICLE,curCluster.vertices);
    }
  }
;
}
Program: 52921
Project: 52921
Buggy source:
protected static CharArraySet getStopWordsForNonLuceneLangFromFile(Version version,Language language){
  try {
    String langCode=language.getLangCode();
    String fileName=STOP_WORDS + langCode + "String_Node_Str";
    InputStream stream=FileUtils.openInputStream(new File(fileName));
    List<String> stopWords=org.apache.commons.io.IOUtils.readLines(stream);
    CharArraySet charArraySet=new CharArraySet(version,0,false);
    for (    String stopWord : stopWords) {
      charArraySet.add(stopWord);
    }
    return charArraySet;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
protected static CharArraySet getStopWordsForNonLuceneLangFromFile(Version version,Language language){
  try {
    String langCode=language.getLangCode();
    String fileName=STOP_WORDS + langCode + "String_Node_Str";
    CharArraySet charArraySet=new CharArraySet(version,0,false);
    File stopWordsFile=new File(fileName);
    if (stopWordsFile.exists()) {
      InputStream stream=FileUtils.openInputStream(new File(fileName));
      List<String> stopWords=org.apache.commons.io.IOUtils.readLines(stream);
      for (      String stopWord : stopWords) {
        charArraySet.add(stopWord);
      }
    }
    return charArraySet;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 52922
Project: 52922
Buggy source:
public static void main(String[] args) throws WikiBrainException {
  GADMConverter converter=new GADMConverter();
  converter.downloadAndConvert(new SpatialDataFolder(new File("String_Node_Str")));
}

Fixed version (ground truth):
public static void main(String[] args) throws WikiBrainException, IOException {
  GADMConverter converter=new GADMConverter();
  converter.downloadAndConvert(new SpatialDataFolder(new File("String_Node_Str")));
}
Program: 52924
Project: 52924
Buggy source:
public static void main(String[] args) throws WikiBrainException {
  GADMConverter converter=new GADMConverter();
  converter.downloadAndConvert(new SpatialDataFolder(new File("String_Node_Str")));
}

Fixed version (ground truth):
public static void main(String[] args) throws WikiBrainException {
  GADMConverter converter=new GADMConverter();
  converter.downloadAndConvert(new File("String_Node_Str"));
}
Program: 52925
Project: 52925
Buggy source:
public static void downloadAndConvert(SpatialDataFolder folder) throws WikiBrainException {
  try {
    WpIOUtils ioUtils=new WpIOUtils();
    String tmpFolderName="String_Node_Str";
    File tmpFolder=WpIOUtils.createTempDirectory(tmpFolderName,true);
    folder.createNewReferenceSystemIfNotExists(tmpFolder.getCanonicalPath());
    File rawFile=downloadGADMShapeFile(tmpFolder.getCanonicalPath());
  }
 catch (  IOException e) {
    throw new WikiBrainException(e);
  }
catch (  ZipException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void downloadAndConvert(File folder) throws WikiBrainException {
  try {
    SpatialDataFolder baseFolder=new SpatialDataFolder(folder);
    WpIOUtils ioUtils=new WpIOUtils();
    String tmpFolderName="String_Node_Str";
    File tmpFolder=WpIOUtils.createTempDirectory(tmpFolderName,true);
    File rawFile=downloadGADMShapeFile(tmpFolder.getCanonicalPath());
    FileUtils.copyDirectory(new File(tmpFolder.getCanonicalPath() + "String_Node_Str"),baseFolder.getRefSysFolder("String_Node_Str"));
    convertShpFile(rawFile,baseFolder,1);
    convertShpFile(rawFile,baseFolder,0);
  }
 catch (  IOException e) {
    throw new WikiBrainException(e);
  }
catch (  ZipException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 52928
Project: 52928
Buggy source:
public static void downloadAndConvert(SpatialDataFolder folder) throws WikiBrainException {
  try {
    WpIOUtils ioUtils=new WpIOUtils();
    String tmpFolderName="String_Node_Str";
    File tmpFolder=WpIOUtils.createTempDirectory(tmpFolderName,true);
    File rawFile=downloadGADMShapeFile(tmpFolder.getCanonicalPath());
    FileUtils.copyDirectory(new File(tmpFolder.getCanonicalPath() + "String_Node_Str"),folder.getRefSysFolder("String_Node_Str"));
    convertShpFile(rawFile,folder,1);
    convertShpFile(rawFile,folder,0);
  }
 catch (  IOException e) {
    throw new WikiBrainException(e);
  }
catch (  ZipException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void downloadAndConvert(SpatialDataFolder folder) throws WikiBrainException {
  try {
    WpIOUtils ioUtils=new WpIOUtils();
    String tmpFolderName="String_Node_Str";
    File tmpFolder=WpIOUtils.createTempDirectory(tmpFolderName,true);
    File rawFile=downloadGADMShapeFile(tmpFolder.getCanonicalPath());
    LOG.log(Level.INFO,"String_Node_Str" + folder.getRefSysFolder("String_Node_Str").getCanonicalPath());
    FileUtils.copyDirectory(new File(tmpFolder.getCanonicalPath()),folder.getRefSysFolder("String_Node_Str"));
    LOG.log(Level.INFO,"String_Node_Str");
    convertShpFile(rawFile,folder,1);
    LOG.log(Level.INFO,"String_Node_Str");
    convertShpFile(rawFile,folder,0);
  }
 catch (  IOException e) {
    throw new WikiBrainException(e);
  }
catch (  ZipException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 52929
Project: 52929
Buggy source:
/** 
 * Download GADM shape file
 * @param tmpFolder
 * @return
 */
public static File downloadGADMShapeFile(String tmpFolder) throws IOException, ZipException, InterruptedException {
  String baseFileName="String_Node_Str";
  String zipFileName=baseFileName + "String_Node_Str";
  String gadmURL="String_Node_Str" + zipFileName;
  Collection<File> tmpFileList;
  File existingFile=null, f=null;
  boolean found=false;
  tmpFileList=FileUtils.listFiles(new File(new File(tmpFolder).getParent()),null,true);
  for (  File file : tmpFileList)   if (file.getName().equals("String_Node_Str")) {
    found=true;
    existingFile=file;
    break;
  }
  if (!found) {
    File gadmShapeFile=new File(tmpFolder + "String_Node_Str" + zipFileName);
    FileDownloader downloader=new FileDownloader();
    downloader.download(new URL(gadmURL),gadmShapeFile);
    ZipFile zipFile=new ZipFile(gadmShapeFile.getCanonicalPath());
    LOG.log(Level.INFO,"String_Node_Str" + gadmShapeFile.getParent());
    zipFile.extractAll(gadmShapeFile.getParent());
    f=new File(tmpFolder + "String_Node_Str");
    LOG.log(Level.INFO,"String_Node_Str");
    return f;
  }
  ZipFile zipFile=new ZipFile(existingFile.getCanonicalPath());
  LOG.log(Level.INFO,"String_Node_Str" + existingFile.getParent());
  zipFile.extractAll(existingFile.getParent());
  f=new File(existingFile.getCanonicalPath() + "String_Node_Str");
  LOG.log(Level.INFO,"String_Node_Str");
  return f;
}

Fixed version (ground truth):
/** 
 * Download GADM shape file
 * @param tmpFolder
 * @return
 */
public static File downloadGADMShapeFile(String tmpFolder) throws IOException, ZipException, InterruptedException {
  String baseFileName="String_Node_Str";
  String zipFileName=baseFileName + "String_Node_Str";
  String gadmURL="String_Node_Str" + zipFileName;
  File gadmShapeFile=new File(tmpFolder + "String_Node_Str" + zipFileName);
  FileDownloader downloader=new FileDownloader();
  downloader.download(new URL(gadmURL),gadmShapeFile);
  ZipFile zipFile=new ZipFile(gadmShapeFile.getCanonicalPath());
  LOG.log(Level.INFO,"String_Node_Str" + gadmShapeFile.getParent());
  zipFile.extractAll(gadmShapeFile.getParent());
  File f=new File(tmpFolder + "String_Node_Str");
  LOG.log(Level.INFO,"String_Node_Str");
  gadmShapeFile.delete();
  return f;
}
Program: 52930
Project: 52930
Buggy source:
public static void downloadAndConvert(File folder) throws WikiBrainException {
  try {
    SpatialDataFolder baseFolder=new SpatialDataFolder(folder);
    WpIOUtils ioUtils=new WpIOUtils();
    String tmpFolderName="String_Node_Str";
    File tmpFolder=WpIOUtils.createTempDirectory(tmpFolderName,true);
    File rawFile=downloadGADMShapeFile(tmpFolder.getCanonicalPath());
    FileUtils.copyDirectory(new File(tmpFolder.getCanonicalPath() + "String_Node_Str"),baseFolder.getRefSysFolder("String_Node_Str"));
    convertShpFile(rawFile,baseFolder,1);
    convertShpFile(rawFile,baseFolder,0);
  }
 catch (  IOException e) {
    throw new WikiBrainException(e);
  }
catch (  ZipException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void downloadAndConvert(File folder) throws WikiBrainException {
  try {
    SpatialDataFolder baseFolder=new SpatialDataFolder(folder);
    WpIOUtils ioUtils=new WpIOUtils();
    String tmpFolderName="String_Node_Str";
    String[] search={"String_Node_Str"};
    File tmpFolder=WpIOUtils.createTempDirectory(tmpFolderName,true);
    File rawFile=downloadGADMShapeFile(tmpFolder.getCanonicalPath());
    LOG.log(Level.INFO,"String_Node_Str" + folder.getCanonicalPath());
    FileUtils.copyDirectory(new File(rawFile.getParent()),baseFolder.getRefSysFolder("String_Node_Str"));
    convertShpFile(rawFile,baseFolder,1);
    convertShpFile(rawFile,baseFolder,0);
  }
 catch (  IOException e) {
    throw new WikiBrainException(e);
  }
catch (  ZipException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 52931
Project: 52931
Buggy source:
/** 
 * Download GADM shape file
 * @param tmpFolder
 * @return
 */
public static File downloadGADMShapeFile(String tmpFolder) throws IOException, ZipException, InterruptedException {
  String baseFileName="String_Node_Str";
  String zipFileName=baseFileName + "String_Node_Str";
  String gadmURL="String_Node_Str" + zipFileName;
  File gadmShapeFile=new File(tmpFolder + "String_Node_Str" + zipFileName);
  FileDownloader downloader=new FileDownloader();
  if (gadmShapeFile.exists() && !gadmShapeFile.isDirectory())   gadmShapeFile.delete();
  downloader.download(new URL(gadmURL),gadmShapeFile);
  ZipFile zipFile=new ZipFile(gadmShapeFile.getCanonicalPath());
  LOG.log(Level.INFO,"String_Node_Str" + gadmShapeFile.getParent() + "String_Node_Str");
  zipFile.extractAll(gadmShapeFile.getParent());
  File f=new File(tmpFolder + "String_Node_Str" + "String_Node_Str");
  LOG.log(Level.INFO,"String_Node_Str");
  gadmShapeFile.delete();
  return f;
}

Fixed version (ground truth):
/** 
 * Download GADM shape file
 * @param tmpFolder
 * @return
 */
public static File downloadGADMShapeFile(String tmpFolder) throws IOException, ZipException, InterruptedException {
  String baseFileName="String_Node_Str";
  String zipFileName=baseFileName + "String_Node_Str";
  String gadmURL="String_Node_Str" + zipFileName;
  Collection<File> tmpFileList;
  File existingFile=null, f=null;
  boolean found=false;
  tmpFileList=FileUtils.listFiles(new File(new File(tmpFolder).getParent()),null,true);
  for (  File file : tmpFileList)   if (file.getName().equals("String_Node_Str")) {
    found=true;
    existingFile=file;
    break;
  }
  if (!found) {
    File gadmShapeFile=new File(tmpFolder + "String_Node_Str" + zipFileName);
    FileDownloader downloader=new FileDownloader();
    downloader.download(new URL(gadmURL),gadmShapeFile);
    ZipFile zipFile=new ZipFile(gadmShapeFile.getCanonicalPath());
    LOG.log(Level.INFO,"String_Node_Str" + gadmShapeFile.getParent());
    zipFile.extractAll(gadmShapeFile.getParent());
    f=new File(tmpFolder + "String_Node_Str");
    LOG.log(Level.INFO,"String_Node_Str");
    return f;
  }
  ZipFile zipFile=new ZipFile(existingFile.getCanonicalPath());
  LOG.log(Level.INFO,"String_Node_Str" + existingFile.getParent());
  zipFile.extractAll(existingFile.getParent());
  f=new File(existingFile.getCanonicalPath() + "String_Node_Str");
  LOG.log(Level.INFO,"String_Node_Str");
  return f;
}
Program: 52933
Project: 52933
Buggy source:
public static void main(String args[]) throws ConfigurationException, DaoException, InterruptedException {
  Env env=EnvBuilder.envFromArgs(args);
  dao=env.getConfigurator().get(LocalLinkDao.class);
  LocalPageDao lpDao=env.getConfigurator().get(LocalPageDao.class);
  for (  LocalPage p : (Iterable<LocalPage>)lpDao.get(new DaoFilter().setRedirect(false).setDisambig(false))) {
    localIds.add(p.toLocalId());
    if (localIds.size() % 100000 == 0) {
      System.err.println("String_Node_Str" + localIds);
    }
  }
  List<Worker> workers=new ArrayList<Worker>();
  long start=System.currentTimeMillis();
  for (int i=0; i < WpThreadUtils.getMaxThreads(); i++) {
    Worker worker=new Worker();
    worker.start();
    workers.add(worker);
  }
  for (  Worker worker : workers) {
    System.out.println("String_Node_Str" + worker);
    worker.join();
  }
  System.out.println("String_Node_Str" + (System.currentTimeMillis() - start) + "String_Node_Str"+ numRows.get()+ "String_Node_Str"+ numCells.get());
}

Fixed version (ground truth):
public static void main(String args[]) throws ConfigurationException, DaoException, InterruptedException {
  Env env=EnvBuilder.envFromArgs(args);
  dao=env.getConfigurator().get(LocalLinkDao.class);
  LocalPageDao lpDao=env.getConfigurator().get(LocalPageDao.class);
  for (  LocalPage p : (Iterable<LocalPage>)lpDao.get(new DaoFilter().setRedirect(false).setDisambig(false))) {
    localIds.add(p.toLocalId());
    if (localIds.size() % 100000 == 0) {
      System.err.println("String_Node_Str" + localIds.size());
    }
  }
  List<Worker> workers=new ArrayList<Worker>();
  long start=System.currentTimeMillis();
  for (int i=0; i < WpThreadUtils.getMaxThreads(); i++) {
    Worker worker=new Worker();
    worker.start();
    workers.add(worker);
  }
  for (  Worker worker : workers) {
    System.out.println("String_Node_Str" + worker);
    worker.join();
  }
  System.out.println("String_Node_Str" + (System.currentTimeMillis() - start) + "String_Node_Str"+ numRows.get()+ "String_Node_Str"+ numCells.get());
}
Program: 52934
Project: 52934
Buggy source:
protected static CharArraySet getStopWordsForNonLuceneLangFromFile(Version version,Language language){
  try {
    String langCode=language.getLangCode();
    String fileName=STOP_WORDS + langCode + "String_Node_Str";
    InputStream stream=FileUtils.openInputStream(new File(fileName));
    List<String> stopWords=org.apache.commons.io.IOUtils.readLines(stream);
    CharArraySet charArraySet=new CharArraySet(version,0,false);
    for (    String stopWord : stopWords) {
      charArraySet.add(stopWord);
    }
    return charArraySet;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
protected static CharArraySet getStopWordsForNonLuceneLangFromFile(Version version,Language language){
  try {
    String langCode=language.getLangCode();
    String fileName=STOP_WORDS + langCode + "String_Node_Str";
    File f=new File(fileName);
    CharArraySet charArraySet=new CharArraySet(version,0,false);
    if (f.exists()) {
      InputStream stream=FileUtils.openInputStream(f);
      List<String> stopWords=org.apache.commons.io.IOUtils.readLines(stream);
      for (      String stopWord : stopWords) {
        charArraySet.add(stopWord);
      }
    }
    return charArraySet;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 52935
Project: 52935
Buggy source:
public static void main(String args[]) throws ConfigurationException, DaoException, IOException {
  MostSimilarInDegrees sim=new MostSimilarInDegrees("String_Node_Str");
  String testTitle="String_Node_Str";
  int degrees=3;
  System.out.println(System.lineSeparator() + "String_Node_Str" + testTitle+ "String_Node_Str"+ degrees+ "String_Node_Str"+ sim.getMostSimilar(testTitle,degrees));
}

Fixed version (ground truth):
public static void main(String args[]) throws ConfigurationException, DaoException, IOException {
  MostSimilarInDegrees sim=new MostSimilarInDegrees("String_Node_Str");
  String testTitle="String_Node_Str";
  int degrees=3;
  System.out.println("String_Node_Str" + testTitle + "String_Node_Str"+ degrees+ "String_Node_Str"+ sim.getMostSimilar(testTitle,degrees));
}
Program: 52937
Project: 52937
Buggy source:
/** 
 * Evaluate all pairs that one location is in "concepts1" and the other one is in "concepts2"
 * @param outputPath
 * @param concepts1
 * @param concepts2
 * @throws IOException
 * @throws DaoException
 * @throws WikapidiaException
 */
public void evaluateBipartite(File outputPath,List<UniversalPage> concepts1,List<UniversalPage> concepts2) throws IOException, DaoException, WikapidiaException {
  this.output=new CSVWriter(new FileWriter(outputPath),',');
  writeHeader();
  if (concepts1.size() == 0 || concepts2.size() == 0)   LOG.warning("String_Node_Str");
  int counter=0;
  int total_size=concepts1.size() * concepts2.size();
  for (  UniversalPage c1 : concepts1) {
    for (    UniversalPage c2 : concepts2) {
      counter++;
      if (counter % 1000 == 0)       LOG.info(String.format("String_Node_Str",counter,total_size));
      if (c1.equals(c2))       continue;
      try {
        List<SRResult> results=new ArrayList<SRResult>();
        for (        Language lang : langs) {
          MonolingualSRMetric sr=metrics.get(lang);
          results.add(sr.similarity(c1.getLocalId(lang),c2.getLocalId(lang),false));
        }
        writeRow(c1,c2,results);
      }
 catch (      Exception e) {
        LOG.warning(String.format("String_Node_Str",c1,c2));
      }
    }
  }
  this.output.close();
}

Fixed version (ground truth):
/** 
 * Evaluate all pairs that one location is in "concepts1" and the other one is in "concepts2"
 * @param outputPath
 * @param concepts1
 * @param concepts2
 * @throws IOException
 * @throws DaoException
 * @throws WikapidiaException
 */
public void evaluateBipartite(File outputPath,List<UniversalPage> concepts1,List<UniversalPage> concepts2) throws IOException, DaoException, WikapidiaException {
  this.output=new CSVWriter(new FileWriter(outputPath),',');
  writeHeader();
  if (concepts1.size() == 0 || concepts2.size() == 0)   LOG.warning("String_Node_Str");
  int counter=0;
  int total_size=concepts1.size() * concepts2.size();
  for (  UniversalPage c1 : concepts1) {
    for (    UniversalPage c2 : concepts2) {
      counter++;
      if (counter % 1000 == 0)       LOG.info(String.format("String_Node_Str",counter,total_size));
      if (c1.equals(c2))       continue;
      try {
        List<SRResult> results=new ArrayList<SRResult>();
        for (        Language lang : langs) {
          MonolingualSRMetric sr=metrics.get(lang);
          results.add(sr.similarity(c1.getLocalId(lang),c2.getLocalId(lang),false));
        }
        writeRow(c1,c2,results);
      }
 catch (      Exception e) {
        LOG.warning(String.format("String_Node_Str",c1.getBestEnglishTitle(lpDao,true),c2.getBestEnglishTitle(lpDao,true)));
      }
    }
  }
  this.output.close();
}
Program: 52938
Project: 52938
Buggy source:
public static void main(String[] args) throws Exception {
  Env env=EnvBuilder.envFromArgs(args);
  Configurator conf=env.getConfigurator();
  ToblersLawEvaluator evaluator=new ToblersLawEvaluator(env,new LanguageSet("String_Node_Str"));
  SpatialDataDao sdDao=conf.get(SpatialDataDao.class);
  Map<Integer,Geometry> allGeometries=sdDao.getAllGeometries("String_Node_Str","String_Node_Str");
  Map<Integer,Geometry> geometryMap=new HashMap<Integer,Geometry>();
  int counter=0;
  for (  Integer id : allGeometries.keySet()) {
    geometryMap.put(id,allGeometries.get(id));
    counter++;
    if (counter >= 100)     break;
  }
  evaluator.retrieveLocations(geometryMap);
  evaluator.evaluateAll(new File("String_Node_Str"));
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  Env env=EnvBuilder.envFromArgs(args);
  Configurator conf=env.getConfigurator();
  ToblersLawEvaluator evaluator=new ToblersLawEvaluator(env,new LanguageSet("String_Node_Str"));
  SpatialDataDao sdDao=conf.get(SpatialDataDao.class);
  Map<Integer,Geometry> allGeometries=sdDao.getAllGeometries("String_Node_Str","String_Node_Str");
  Map<Integer,Geometry> geometryMap=new HashMap<Integer,Geometry>();
  int counter=0;
  for (  Integer id : allGeometries.keySet()) {
    geometryMap.put(id,allGeometries.get(id));
    counter++;
    if (counter >= 100)     break;
  }
  evaluator.retrieveAllLocations();
  evaluator.evaluateSample(new File("String_Node_Str"),1000000);
}