nus-yam/ex-repair huggingface dataset:
Program: 52939
Project: 52939
Buggy source:
public static void main(String[] args){
  try {
    Env env=new EnvBuilder().build();
    Configurator c=env.getConfigurator();
    SpatialNeighborDao snDao=c.get(SpatialNeighborDao.class);
    WikidataDao wdDao=c.get(WikidataDao.class);
    LocalPageDao lpDao=c.get(LocalPageDao.class);
    LanguageSet loadedLangs=lpDao.getLoadedLanguages();
    String originName="String_Node_Str";
    String layerName="String_Node_Str";
    Set<String> subLayers=Sets.newHashSet();
    subLayers.add("String_Node_Str");
    LocalPage lp=lpDao.getByTitle(new Title(originName,Language.getByLangCode("String_Node_Str")),NameSpace.ARTICLE);
    Integer id=wdDao.getItemId(lp);
    TIntSet neighborItemIds=snDao.getNeighboringItemIds(id,layerName,"String_Node_Str",subLayers,1,50);
    int counter=0;
    System.out.println("String_Node_Str" + lp.getTitle() + "String_Node_Str");
    for (    int cId : neighborItemIds.toArray()) {
      UniversalPage univPage=wdDao.getUniversalPage(cId);
      Title t=univPage.getBestEnglishTitle(lpDao,true);
      System.out.println(t.getCanonicalTitle());
      counter++;
    }
    System.out.printf("String_Node_Str",counter);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    Env env=new EnvBuilder().build();
    Configurator c=env.getConfigurator();
    SpatialNeighborDao snDao=c.get(SpatialNeighborDao.class);
    WikidataDao wdDao=c.get(WikidataDao.class);
    LocalPageDao lpDao=c.get(LocalPageDao.class);
    SpatialDataDao sdDao=c.get(SpatialDataDao.class);
    LanguageSet loadedLangs=lpDao.getLoadedLanguages();
    String originName="String_Node_Str";
    String layerName="String_Node_Str";
    Set<String> subLayers=Sets.newHashSet();
    subLayers.add("String_Node_Str");
    LocalPage lp=lpDao.getByTitle(new Title(originName,Language.getByLangCode("String_Node_Str")),NameSpace.ARTICLE);
    Integer id=wdDao.getItemId(lp);
    TIntSet neighborItemIds=snDao.getNeighboringItemIds(id,layerName,"String_Node_Str",subLayers,800,1000);
    Point p1=sdDao.getGeometry(id,layerName,"String_Node_Str").getCentroid();
    int counter=0;
    System.out.println("String_Node_Str" + lp.getTitle() + "String_Node_Str");
    for (    int cId : neighborItemIds.toArray()) {
      UniversalPage univPage=wdDao.getUniversalPage(cId);
      Title t=univPage.getBestEnglishTitle(lpDao,true);
      System.out.println();
      Point p2=sdDao.getGeometry(cId,"String_Node_Str","String_Node_Str").getCentroid();
      GeodeticCalculator geoCalc=new GeodeticCalculator();
      geoCalc.setStartingGeographicPoint(p1.getX(),p1.getY());
      geoCalc.setDestinationGeographicPoint(p2.getX(),p2.getY());
      System.out.println(t.getCanonicalTitle() + "String_Node_Str" + geoCalc.getOrthodromicDistance() / 1000);
      counter++;
    }
    System.out.printf("String_Node_Str",counter);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 52941
Project: 52941
Buggy source:
/** 
 * Downloads the GADM shape file
 */
public void downloadGADMShapeFile(){
  if (countryCode.isEmpty()) {
    buildCodeMap();
  }
  String fileName="String_Node_Str";
  String gadmURL="String_Node_Str" + fileName;
  File gadmShapeFile=new File("String_Node_Str" + fileName);
  try {
    System.out.println("String_Node_Str" + "String_Node_Str");
    FileUtils.copyURLToFile(new URL(gadmURL),gadmShapeFile,5000,5000);
    System.out.println("String_Node_Str");
    System.out.println(gadmShapeFile.getAbsolutePath());
    ZipFile zipFile=new ZipFile(gadmShapeFile.getAbsolutePath());
    System.out.println("String_Node_Str");
    zipFile.extractAll(gadmShapeFile.getParent() + "String_Node_Str");
    System.out.println("String_Node_Str");
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ZipException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Download GADM shape file
 */
public void downloadGADMShapeFile(){
  String fileName="String_Node_Str";
  String gadmURL="String_Node_Str" + fileName;
  File gadmShapeFile=new File("String_Node_Str" + fileName);
  try {
    System.out.println("String_Node_Str" + "String_Node_Str");
    FileUtils.copyURLToFile(new URL(gadmURL),gadmShapeFile,5000,5000);
    System.out.println("String_Node_Str");
    System.out.println(gadmShapeFile.getAbsolutePath());
    ZipFile zipFile=new ZipFile(gadmShapeFile.getAbsolutePath());
    System.out.println("String_Node_Str");
    zipFile.extractAll(gadmShapeFile.getParent() + "String_Node_Str");
    System.out.println("String_Node_Str");
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ZipException e) {
    e.printStackTrace();
  }
}
Program: 52942
Project: 52942
Buggy source:
public void convertShpFile(ShpFiles shpFile){
  DbaseFileReader dbfReader;
  DbaseFileWriter dbfWriter;
  DbaseFileHeader dbfHeader;
  Object[] entry, newEntry=new Object[2];
  try {
    dbfReader=new DbaseFileReader(shpFile,false,Charset.forName("String_Node_Str"));
    dbfHeader=new DbaseFileHeader();
    WritableByteChannel out=new FileOutputStream("String_Node_Str").getChannel();
    dbfWriter=new DbaseFileWriter(dbfHeader,out);
    dbfHeader.addColumn("String_Node_Str",'c',254,0);
    dbfHeader.addColumn("String_Node_Str",'c',254,0);
    while (dbfReader.hasNext()) {
      entry=dbfReader.readEntry();
      newEntry[0]=(String)entry[5];
      newEntry[1]=(String)entry[5] + "String_Node_Str" + (String)entry[3];
      dbfWriter.write(newEntry);
    }
    dbfWriter.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Convert GADM shapefile into the format we can read
 * @param shpFile
 */
public void convertShpFile(ShpFiles shpFile){
  DbaseFileReader dbfReader;
  DbaseFileWriter dbfWriter;
  DbaseFileHeader dbfHeader;
  Object[] entry, newEntry=new Object[2];
  try {
    dbfReader=new DbaseFileReader(shpFile,false,Charset.forName("String_Node_Str"));
    dbfHeader=new DbaseFileHeader();
    FileOutputStream out=new FileOutputStream("String_Node_Str");
    dbfWriter=new DbaseFileWriter(dbfHeader,out.getChannel());
    dbfHeader.addColumn("String_Node_Str",'c',20,0);
    dbfHeader.addColumn("String_Node_Str",'c',20,0);
    while (dbfReader.hasNext()) {
      entry=dbfReader.readEntry();
      newEntry[0]=(String)entry[5];
      newEntry[1]=(String)entry[5] + "String_Node_Str" + (String)entry[3];
      dbfWriter.write(newEntry);
    }
    dbfWriter.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 52943
Project: 52943
Buggy source:
/** 
 * Convert GADM shapefile into the format we can read
 * @param shpFile
 */
public void convertShpFile(ShpFiles shpFile){
  DbaseFileReader dbfReader;
  DbaseFileWriter dbfWriter;
  DbaseFileHeader dbfHeader;
  Object[] entry, newEntry=new Object[2];
  try {
    dbfReader=new DbaseFileReader(shpFile,false,Charset.forName("String_Node_Str"));
    dbfHeader=new DbaseFileHeader();
    FileOutputStream out=new FileOutputStream("String_Node_Str");
    dbfWriter=new DbaseFileWriter(dbfHeader,out.getChannel());
    dbfHeader.addColumn("String_Node_Str",'c',20,0);
    dbfHeader.addColumn("String_Node_Str",'c',20,0);
    while (dbfReader.hasNext()) {
      entry=dbfReader.readEntry();
      newEntry[0]=(String)entry[5];
      newEntry[1]=(String)entry[5] + "String_Node_Str" + (String)entry[3];
      dbfWriter.write(newEntry);
    }
    dbfWriter.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Convert GADM shapefile into the format we can read
 * @param shpFile
 */
public void convertShpFile(ShpFiles shpFile){
  DbaseFileReader dbfReader;
  DbaseFileWriter dbfWriter;
  DbaseFileHeader dbfHeader;
  Object[] entry, newEntry=new Object[2];
  try {
    dbfReader=new DbaseFileReader(shpFile,false,Charset.forName("String_Node_Str"));
    dbfHeader=new DbaseFileHeader();
    dbfHeader.addColumn("String_Node_Str",'c',254,0);
    dbfHeader.addColumn("String_Node_Str",'c',254,0);
    File f=new File("String_Node_Str");
    FileOutputStream out=new FileOutputStream(f);
    dbfWriter=new DbaseFileWriter(dbfHeader,out.getChannel(),Charset.forName("String_Node_Str"));
    int count=0;
    HashMap<Integer,HashSet<Integer>> id=new HashMap<Integer,HashSet<Integer>>();
    while (dbfReader.hasNext()) {
      entry=dbfReader.readEntry();
      if (!id.containsKey(entry[1]))       id.put((Integer)entry[1],new HashSet<Integer>());
      if (!id.get(entry[1]).contains(entry[4])) {
        count++;
        newEntry[0]=(String)entry[5];
        newEntry[1]=(String)entry[5] + "String_Node_Str" + (String)entry[3];
        dbfWriter.write(newEntry);
        id.get(entry[1]).add((Integer)entry[4]);
      }
 else       continue;
    }
    System.out.println("String_Node_Str" + count);
    dbfWriter.close();
    out.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 52944
Project: 52944
Buggy source:
protected static Geometry jsonToGeometry(JsonObject json){
  try {
    Double latitude=json.get("String_Node_Str").getAsDouble();
    Double longitude=json.get("String_Node_Str").getAsDouble();
    String globe=json.get("String_Node_Str").getAsString();
    if (globe != null && (!globe.endsWith(EARTH_ITEM_ID) || !globe.endsWith("String_Node_Str"))) {
      LOG.log(Level.INFO,"String_Node_Str" + json);
      return null;
    }
    Coordinate[] coords=new Coordinate[1];
    coords[0]=new Coordinate(longitude,latitude);
    CoordinateArraySequence coordArraySeq=new CoordinateArraySequence(coords);
    Point p=new Point(coordArraySeq,new GeometryFactory());
    return p;
  }
 catch (  Exception e) {
    LOG.log(Level.WARNING,"String_Node_Str" + json + "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
    return null;
  }
}

Fixed version (ground truth):
protected static Geometry jsonToGeometry(JsonObject json){
  try {
    Double latitude=json.get("String_Node_Str").getAsDouble();
    Double longitude=json.get("String_Node_Str").getAsDouble();
    String globe=null;
    try {
      globe=json.get("String_Node_Str").getAsString();
    }
 catch (    Exception e) {
    }
    if (globe != null && !(globe.endsWith(EARTH_ITEM_ID) || globe.endsWith("String_Node_Str"))) {
      LOG.log(Level.INFO,"String_Node_Str" + json);
      return null;
    }
    Coordinate[] coords=new Coordinate[1];
    coords[0]=new Coordinate(longitude,latitude);
    CoordinateArraySequence coordArraySeq=new CoordinateArraySequence(coords);
    Point p=new Point(coordArraySeq,new GeometryFactory());
    return p;
  }
 catch (  Exception e) {
    LOG.log(Level.WARNING,"String_Node_Str" + json + "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
    return null;
  }
}
Program: 52945
Project: 52945
Buggy source:
public static void main(String args[]) throws ConfigurationException, WikapidiaException {
  Options options=new Options();
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").create("String_Node_Str"));
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").create("String_Node_Str"));
  EnvBuilder.addStandardOptions(options);
  CommandLineParser parser=new PosixParser();
  CommandLine cmd;
  try {
    cmd=parser.parse(options,args);
  }
 catch (  ParseException e) {
    System.err.println("String_Node_Str" + e.getMessage());
    new HelpFormatter().printHelp("String_Node_Str",options);
    return;
  }
  Env env=new EnvBuilder(cmd).build();
  Configurator conf=env.getConfigurator();
  String phraseAnalyzerName=cmd.getOptionValue("String_Node_Str","String_Node_Str");
  PhraseAnalyzer phraseAnalyzer=conf.get(PhraseAnalyzer.class,phraseAnalyzerName);
  String spatialDataFolderPath=cmd.getOptionValue('f');
  File spatialDataFolder=new File("String_Node_Str");
  WikidataDao wdDao=conf.get(WikidataDao.class);
  SpatialDataDao spatialDataDao=conf.get(SpatialDataDao.class);
  LOG.log(Level.INFO,"String_Node_Str" + spatialDataFolderPath + "String_Node_Str");
  SpatialDataLoader loader=new SpatialDataLoader(spatialDataDao,wdDao,phraseAnalyzer,spatialDataFolder);
  loader.loadExogenousData();
}

Fixed version (ground truth):
public static void main(String args[]) throws ConfigurationException, WikapidiaException {
  Options options=new Options();
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").create("String_Node_Str"));
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").create("String_Node_Str"));
  EnvBuilder.addStandardOptions(options);
  CommandLineParser parser=new PosixParser();
  CommandLine cmd;
  try {
    cmd=parser.parse(options,args);
  }
 catch (  ParseException e) {
    System.err.println("String_Node_Str" + e.getMessage());
    new HelpFormatter().printHelp("String_Node_Str",options);
    return;
  }
  Env env=new EnvBuilder(cmd).build();
  Configurator conf=env.getConfigurator();
  String phraseAnalyzerName=cmd.getOptionValue("String_Node_Str","String_Node_Str");
  PhraseAnalyzer phraseAnalyzer=conf.get(PhraseAnalyzer.class,phraseAnalyzerName);
  File spatialDataFolder=new File("String_Node_Str");
  String spatialDataFolderPath=new String("String_Node_Str");
  WikidataDao wdDao=conf.get(WikidataDao.class);
  SpatialDataDao spatialDataDao=conf.get(SpatialDataDao.class);
  LOG.log(Level.INFO,"String_Node_Str" + spatialDataFolderPath + "String_Node_Str");
  SpatialDataLoader loader=new SpatialDataLoader(spatialDataDao,wdDao,phraseAnalyzer,spatialDataFolder);
  loader.loadWikidataData();
}
Program: 52946
Project: 52946
Buggy source:
@Override public PostGISDB get(String name,Config config,Map<String,String> runtimeParams) throws ConfigurationException {
  try {
    if (PostGISDB.instance != null) {
      Map<String,Object> params=Maps.newHashMap();
      ConfigObject cObject=config.root();
      for (      String key : cObject.keySet()) {
        params.put(key,cObject.get(key).unwrapped());
      }
      PostGISDB.instance=new PostGISDB(params);
    }
    return PostGISDB.instance;
  }
 catch (  DaoException e) {
    throw new ConfigurationException(e);
  }
}

Fixed version (ground truth):
@Override public PostGISDB get(String name,Config config,Map<String,String> runtimeParams) throws ConfigurationException {
  try {
    if (PostGISDB.instance == null) {
      Map<String,Object> params=Maps.newHashMap();
      ConfigObject cObject=config.root();
      for (      String key : cObject.keySet()) {
        params.put(key,cObject.get(key).unwrapped());
      }
      PostGISDB.instance=new PostGISDB(params);
    }
    return PostGISDB.instance;
  }
 catch (  DaoException e) {
    throw new ConfigurationException(e);
  }
}
Program: 52948
Project: 52948
Buggy source:
@Override public Class getType(){
  return SpatialDataDao.class;
}

Fixed version (ground truth):
@Override public Class getType(){
  return SpatialContainmentDao.class;
}
Program: 52949
Project: 52949
Buggy source:
public static void main(String args[]) throws ConfigurationException, WikapidiaException {
  Options options=new Options();
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").create("String_Node_Str"));
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").create("String_Node_Str"));
  EnvBuilder.addStandardOptions(options);
  CommandLineParser parser=new PosixParser();
  CommandLine cmd;
  try {
    cmd=parser.parse(options,args);
  }
 catch (  ParseException e) {
    System.err.println("String_Node_Str" + e.getMessage());
    new HelpFormatter().printHelp("String_Node_Str",options);
    return;
  }
  Env env=new EnvBuilder(cmd).build();
  Configurator conf=env.getConfigurator();
  String phraseAnalyzerName=cmd.getOptionValue("String_Node_Str","String_Node_Str");
  PhraseAnalyzer phraseAnalyzer=conf.get(PhraseAnalyzer.class,phraseAnalyzerName);
  String spatialDataFolderPath=cmd.getOptionValue('f');
  File spatialDataFolder=new File("String_Node_Str");
  WikidataDao wdDao=conf.get(WikidataDao.class);
  SpatialDataDao spatialDataDao=conf.get(SpatialDataDao.class);
  LOG.log(Level.INFO,"String_Node_Str" + spatialDataFolderPath + "String_Node_Str");
  SpatialDataLoader loader=new SpatialDataLoader(spatialDataDao,wdDao,phraseAnalyzer,spatialDataFolder);
  loader.loadWikidataData();
}

Fixed version (ground truth):
public static void main(String args[]) throws ConfigurationException, WikapidiaException {
  Options options=new Options();
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").create("String_Node_Str"));
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").create("String_Node_Str"));
  EnvBuilder.addStandardOptions(options);
  CommandLineParser parser=new PosixParser();
  CommandLine cmd;
  try {
    cmd=parser.parse(options,args);
  }
 catch (  ParseException e) {
    System.err.println("String_Node_Str" + e.getMessage());
    new HelpFormatter().printHelp("String_Node_Str",options);
    return;
  }
  Env env=new EnvBuilder(cmd).build();
  Configurator conf=env.getConfigurator();
  String phraseAnalyzerName=cmd.getOptionValue("String_Node_Str","String_Node_Str");
  PhraseAnalyzer phraseAnalyzer=conf.get(PhraseAnalyzer.class,phraseAnalyzerName);
  String spatialDataFolderPath=cmd.getOptionValue('f');
  File spatialDataFolder=new File("String_Node_Str");
  WikidataDao wdDao=conf.get(WikidataDao.class);
  SpatialDataDao spatialDataDao=conf.get(SpatialDataDao.class);
  LOG.log(Level.INFO,"String_Node_Str" + spatialDataFolderPath + "String_Node_Str");
  SpatialDataLoader loader=new SpatialDataLoader(spatialDataDao,wdDao,phraseAnalyzer,spatialDataFolder);
  loader.loadExogenousData();
}
Program: 52950
Project: 52950
Buggy source:
public String getStringValue(){
  return (String)value;
}

Fixed version (ground truth):
public String getStringValue(){
  return value.toString();
}
Program: 52951
Project: 52951
Buggy source:
public static Object gsonToPrimitive(JsonElement element){
  if (element.isJsonPrimitive()) {
    JsonPrimitive prim=element.getAsJsonPrimitive();
    if (prim.isString()) {
      return prim.getAsString();
    }
 else     if (prim.isBoolean()) {
      return prim.getAsBoolean();
    }
 else     if (prim.isNumber()) {
      return prim.getAsInt();
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + prim);
    }
  }
 else   if (element.isJsonArray()) {
    JsonArray array=element.getAsJsonArray();
    List<Object> list=new ArrayList<Object>();
    for (int i=0; i < array.size(); i++) {
      list.add(gsonToPrimitive(array.get(i)));
    }
    return list;
  }
 else   if (element.isJsonNull()) {
    return null;
  }
 else   if (element.isJsonObject()) {
    Map<String,Object> map=new HashMap<String,Object>();
    for (    Map.Entry<String,JsonElement> entry : element.getAsJsonObject().entrySet()) {
      map.put(entry.getKey(),gsonToPrimitive(entry.getValue()));
    }
    return map;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + element);
  }
}

Fixed version (ground truth):
public static Object gsonToPrimitive(JsonElement element){
  if (element.isJsonPrimitive()) {
    JsonPrimitive prim=element.getAsJsonPrimitive();
    if (prim.isString()) {
      return prim.getAsString();
    }
 else     if (prim.isBoolean()) {
      return prim.getAsBoolean();
    }
 else     if (prim.isNumber()) {
      return prim.getAsNumber();
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + prim);
    }
  }
 else   if (element.isJsonArray()) {
    JsonArray array=element.getAsJsonArray();
    List<Object> list=new ArrayList<Object>();
    for (int i=0; i < array.size(); i++) {
      list.add(gsonToPrimitive(array.get(i)));
    }
    return list;
  }
 else   if (element.isJsonNull()) {
    return null;
  }
 else   if (element.isJsonObject()) {
    Map<String,Object> map=new HashMap<String,Object>();
    for (    Map.Entry<String,JsonElement> entry : element.getAsJsonObject().entrySet()) {
      map.put(entry.getKey(),gsonToPrimitive(entry.getValue()));
    }
    return map;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + element);
  }
}
Program: 52952
Project: 52952
Buggy source:
@Override public LinkedHashMap<String,Float> describeUniversal(Language language,UniversalPage page,int maxPhrases){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public LinkedHashMap<String,Float> describeUniversal(Language language,UniversalPage page,int maxPhrases){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 52953
Project: 52953
Buggy source:
@Override public LinkedHashMap<UniversalPage,Float> resolveUniversal(Language language,String phrase,int algorithmId,int maxPages){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public LinkedHashMap<UniversalPage,Float> resolveUniversal(Language language,String phrase,int algorithmId,int maxPages){
  throw new UnsupportedOperationException();
}
Program: 52954
Project: 52954
Buggy source:
@Override public LocalWikidataStatement getLocalStatement(Language language,WikidataStatement statement) throws DaoException {
  language=getRealLang(language);
  String item=getLocalName(language,statement.getItem().getType(),statement.getItem().getId());
  String prop=getLocalName(language,statement.getProperty().getType(),statement.getProperty().getId());
  String value=null;
  WikidataValue wdv=statement.getValue();
  if (wdv.getType() == WikidataValue.Type.ITEM) {
    value=getLocalName(language,WikidataEntity.Type.ITEM,wdv.getItemValue());
  }
 else   if (wdv == null) {
    value="String_Node_Str";
  }
 else {
    value=wdv.getValue().toString();
  }
  String full=item + "String_Node_Str" + prop+ "String_Node_Str"+ value;
  return new LocalWikidataStatement(language,statement,full,item,prop,value);
}

Fixed version (ground truth):
@Override public LocalWikidataStatement getLocalStatement(Language language,WikidataStatement statement) throws DaoException {
  language=getRealLang(language);
  String item=getLocalName(language,statement.getItem().getType(),statement.getItem().getId());
  String prop=getLocalName(language,statement.getProperty().getType(),statement.getProperty().getId());
  String value=null;
  WikidataValue wdv=statement.getValue();
  if (wdv.getType() == WikidataValue.Type.ITEM) {
    value=getLocalName(language,WikidataEntity.Type.ITEM,wdv.getItemValue());
  }
 else   if (wdv.getValue() == null) {
    value="String_Node_Str";
  }
 else {
    value=wdv.getValue().toString();
  }
  String full=item + "String_Node_Str" + prop+ "String_Node_Str"+ value;
  return new LocalWikidataStatement(language,statement,full,item,prop,value);
}
Program: 52955
Project: 52955
Buggy source:
/** 
 * Find a shortest chain between two articles using the Bi-directional BFS Prints out the chain, the number of links visited and the number of nodes visited
 * @param srcTitle The page title of source article
 * @param dstTitle The page title of destination article
 * @return The number of degree of the chain found
 * @throws DaoException
 */
public int getRelationBidirectional(String srcTitle,String dstTitle) throws DaoException, ConfigurationException {
  Integer srcId=pDao.getIdByTitle(srcTitle,lang,NameSpace.ARTICLE);
  Integer dstId=pDao.getIdByTitle(dstTitle,lang,NameSpace.ARTICLE);
  return getRelationBidirectional(srcId,dstId);
}

Fixed version (ground truth):
/** 
 * Find a shortest chain between two articles using the Bi-directional BFS Prints out the chain, the number of links visited and the number of nodes visited
 * @param srcTitle The page title of source article
 * @param dstTitle The page title of destination article
 * @return The number of degree of the chain found
 * @throws DaoException
 */
public int getRelationBidirectional(String srcTitle,String dstTitle) throws DaoException, ConfigurationException {
  Integer srcId=pDao.getIdByTitle(srcTitle,lang,NameSpace.ARTICLE);
  Integer dstId=pDao.getIdByTitle(dstTitle,lang,NameSpace.ARTICLE);
  if (srcId == -1 || dstId == -1)   throw new DaoException("String_Node_Str");
  return getRelationBidirectional(srcId,dstId);
}
Program: 52956
Project: 52956
Buggy source:
/** 
 * Find the shortest chain between two articles (using naive uni-directional BFS, much slower than the bi-directional version) Prints out the chain, the number of links visited and the number of nodes visited
 * @param srcTitle The page title of source article
 * @param dstTitle The page title of destination article
 * @return The number of degree of the chain found
 * @throws DaoException
 */
public int getRelation(String srcTitle,String dstTitle) throws DaoException {
  Integer srcId=pDao.getIdByTitle(srcTitle,lang,NameSpace.ARTICLE);
  Integer dstId=pDao.getIdByTitle(dstTitle,lang,NameSpace.ARTICLE);
  return getRelation(srcId,dstId);
}

Fixed version (ground truth):
/** 
 * Find the shortest chain between two articles (using naive uni-directional BFS, much slower than the bi-directional version) Prints out the chain, the number of links visited and the number of nodes visited
 * @param srcTitle The page title of source article
 * @param dstTitle The page title of destination article
 * @return The number of degree of the chain found
 * @throws DaoException
 */
public int getRelation(String srcTitle,String dstTitle) throws DaoException {
  Integer srcId=pDao.getIdByTitle(srcTitle,lang,NameSpace.ARTICLE);
  Integer dstId=pDao.getIdByTitle(dstTitle,lang,NameSpace.ARTICLE);
  if (srcId == -1 || dstId == -1)   throw new DaoException("String_Node_Str");
  return getRelation(srcId,dstId);
}
Program: 52957
Project: 52957
Buggy source:
/** 
 * Find a chain between two articles (using the SR (semantic relatedness) between the current article and the destination article as heuristic) Prints out the chain, the number of links visited and the number of nodes visited
 * @param srcTitle The page title of source article
 * @param dstTitle The page title of destination article
 * @return The number of degree of the chain found
 * @throws DaoException
 */
public int getRelationSR(String srcTitle,String dstTitle) throws DaoException, ConfigurationException {
  Integer srcId=pDao.getIdByTitle(srcTitle,lang,NameSpace.ARTICLE);
  Integer dstId=pDao.getIdByTitle(dstTitle,lang,NameSpace.ARTICLE);
  return getRelationSR(srcId,dstId);
}

Fixed version (ground truth):
/** 
 * Find a chain between two articles (using the SR (semantic relatedness) between the current article and the destination article as heuristic) Prints out the chain, the number of links visited and the number of nodes visited
 * @param srcTitle The page title of source article
 * @param dstTitle The page title of destination article
 * @return The number of degree of the chain found
 * @throws DaoException
 */
public int getRelationSR(String srcTitle,String dstTitle) throws DaoException, ConfigurationException {
  Integer srcId=pDao.getIdByTitle(srcTitle,lang,NameSpace.ARTICLE);
  Integer dstId=pDao.getIdByTitle(dstTitle,lang,NameSpace.ARTICLE);
  if (srcId == -1 || dstId == -1)   throw new DaoException("String_Node_Str");
  return getRelationSR(srcId,dstId);
}
Program: 52958
Project: 52958
Buggy source:
public static void main(String args[]) throws ConfigurationException, DaoException, IOException {
  ConceptRelation cr=new ConceptRelation(Language.getByLangCode("String_Node_Str"));
  System.out.println(cr.getRelationSR("String_Node_Str","String_Node_Str"));
  System.out.println(cr.getRelationBidirectional("String_Node_Str","String_Node_Str"));
  Integer srcId=1527;
  Integer dstId=43788;
}

Fixed version (ground truth):
public static void main(String args[]) throws ConfigurationException, DaoException, IOException {
  ConceptRelation cr=new ConceptRelation(Language.getByLangCode("String_Node_Str"));
  System.out.println(cr.getRelationSR("String_Node_Str","String_Node_Str"));
  System.out.println(cr.getRelationBidirectional("String_Node_Str","String_Node_Str"));
  Integer srcId=1527;
  Integer dstId=43788;
  System.out.println(cr.getWikidataRelation(srcId,dstId));
}
Program: 52959
Project: 52959
Buggy source:
@Test public void testLocalStatements() throws DaoException, IOException, ClassNotFoundException {
  WpDataSource ds=TestDaoUtil.getWpDataSource(dbDir);
  WikidataDao wd=new WikidataSqlDao(ds);
  Map<String,List<LocalWikidataStatement>> statements=wd.getLocalStatements(EN,WikidataEntity.Type.ITEM,157);
  assertEquals(25,statements.keySet().size());
  for (  String prop : statements.keySet()) {
    System.out.println("String_Node_Str" + prop + "String_Node_Str");
    for (    LocalWikidataStatement st : statements.get(prop)) {
      System.out.println("String_Node_Str" + st.getFullStatement());
    }
  }
  List<LocalWikidataStatement> almaMaters=statements.get("String_Node_Str");
  assertEquals(4,almaMaters.size());
  for (  LocalWikidataStatement lws : almaMaters) {
    assertEquals("String_Node_Str",lws.getFullStatement());
  }
}

Fixed version (ground truth):
@Test public void testLocalStatements() throws DaoException, IOException, ClassNotFoundException {
  WpDataSource ds=TestDaoUtil.getWpDataSource(dbDir);
  WikidataDao wd=new WikidataSqlDao(ds,null,null);
  Map<String,List<LocalWikidataStatement>> statements=wd.getLocalStatements(EN,WikidataEntity.Type.ITEM,157);
  assertEquals(25,statements.keySet().size());
  for (  String prop : statements.keySet()) {
    System.out.println("String_Node_Str" + prop + "String_Node_Str");
    for (    LocalWikidataStatement st : statements.get(prop)) {
      System.out.println("String_Node_Str" + st.getFullStatement());
    }
  }
  List<LocalWikidataStatement> almaMaters=statements.get("String_Node_Str");
  assertEquals(4,almaMaters.size());
  for (  LocalWikidataStatement lws : almaMaters) {
    assertEquals("String_Node_Str",lws.getFullStatement());
  }
}
Program: 52960
Project: 52960
Buggy source:
@Test public void testItem() throws DaoException, IOException, ClassNotFoundException {
  WpDataSource ds=TestDaoUtil.getWpDataSource(dbDir);
  WikidataDao wd=new WikidataSqlDao(ds);
  WikidataEntity entity=wd.getItem(157);
  assertEquals(157,entity.getId());
  assertEquals(WikidataEntity.Type.ITEM,entity.getType());
  assertEquals("String_Node_Str",entity.getLabels().get(Language.getByLangCode("String_Node_Str")));
  assertEquals("String_Node_Str",entity.getLabels().get(Language.getByLangCode("String_Node_Str")));
  assertEquals("String_Node_Str",entity.getDescriptions().get(Language.getByLangCode("String_Node_Str")));
  assertTrue(entity.getAliases().get(Language.getByLangCode("String_Node_Str")).contains("String_Node_Str"));
  assertEquals(36,entity.getStatements().size());
  Map<String,List<WikidataStatement>> statements=entity.getStatementsInLanguage(Language.getByLangCode("String_Node_Str"));
  assertEquals(4,statements.get("String_Node_Str").size());
  TIntSet ids=new TIntHashSet();
  for (  WikidataStatement st : statements.get("String_Node_Str")) {
    assertEquals(166,st.getProperty().getId());
    assertEquals("String_Node_Str",st.getProperty().getLabels().get(EN));
    assertEquals(WikidataValue.Type.ITEM,st.getValue().getType());
    ids.add(st.getValue().getItemValue());
  }
  assertEquals(new TIntHashSet(new int[]{84020,10855226,13422143,14539990}),ids);
}

Fixed version (ground truth):
@Test public void testItem() throws DaoException, IOException, ClassNotFoundException {
  WpDataSource ds=TestDaoUtil.getWpDataSource(dbDir);
  WikidataDao wd=new WikidataSqlDao(ds,null,null);
  WikidataEntity entity=wd.getItem(157);
  assertEquals(157,entity.getId());
  assertEquals(WikidataEntity.Type.ITEM,entity.getType());
  assertEquals("String_Node_Str",entity.getLabels().get(Language.getByLangCode("String_Node_Str")));
  assertEquals("String_Node_Str",entity.getLabels().get(Language.getByLangCode("String_Node_Str")));
  assertEquals("String_Node_Str",entity.getDescriptions().get(Language.getByLangCode("String_Node_Str")));
  assertTrue(entity.getAliases().get(Language.getByLangCode("String_Node_Str")).contains("String_Node_Str"));
  assertEquals(36,entity.getStatements().size());
  Map<String,List<WikidataStatement>> statements=entity.getStatementsInLanguage(Language.getByLangCode("String_Node_Str"));
  assertEquals(4,statements.get("String_Node_Str").size());
  TIntSet ids=new TIntHashSet();
  for (  WikidataStatement st : statements.get("String_Node_Str")) {
    assertEquals(166,st.getProperty().getId());
    assertEquals("String_Node_Str",st.getProperty().getLabels().get(EN));
    assertEquals(WikidataValue.Type.ITEM,st.getValue().getType());
    ids.add(st.getValue().getItemValue());
  }
  assertEquals(new TIntHashSet(new int[]{84020,10855226,13422143,14539990}),ids);
}
Program: 52961
Project: 52961
Buggy source:
@Test public void testProps() throws DaoException, IOException, ClassNotFoundException {
  WpDataSource ds=TestDaoUtil.getWpDataSource(dbDir);
  WikidataDao wd=new WikidataSqlDao(ds);
  Map<Integer,WikidataEntity> props=wd.getProperties();
  assertEquals(props.size(),836);
  assertTrue(props.containsKey(127));
  WikidataEntity entity=wd.getProperty(127);
  assertEquals(127,entity.getId());
  assertEquals(WikidataEntity.Type.PROPERTY,entity.getType());
  assertEquals("String_Node_Str",entity.getLabels().get(EN));
  assertEquals("String_Node_Str",entity.getLabels().get(Language.getByLangCode("String_Node_Str")));
  assertEquals("String_Node_Str",entity.getDescriptions().get(EN));
  assertTrue(entity.getAliases().get(Language.getByLangCode("String_Node_Str")).contains("String_Node_Str"));
  assertEquals(0,entity.getStatements().size());
}

Fixed version (ground truth):
@Test public void testProps() throws DaoException, IOException, ClassNotFoundException {
  WpDataSource ds=TestDaoUtil.getWpDataSource(dbDir);
  WikidataDao wd=new WikidataSqlDao(ds,null,null);
  Map<Integer,WikidataEntity> props=wd.getProperties();
  assertEquals(props.size(),836);
  assertTrue(props.containsKey(127));
  WikidataEntity entity=wd.getProperty(127);
  assertEquals(127,entity.getId());
  assertEquals(WikidataEntity.Type.PROPERTY,entity.getType());
  assertEquals("String_Node_Str",entity.getLabels().get(EN));
  assertEquals("String_Node_Str",entity.getLabels().get(Language.getByLangCode("String_Node_Str")));
  assertEquals("String_Node_Str",entity.getDescriptions().get(EN));
  assertTrue(entity.getAliases().get(Language.getByLangCode("String_Node_Str")).contains("String_Node_Str"));
  assertEquals(0,entity.getStatements().size());
}
Program: 52962
Project: 52962
Buggy source:
@BeforeClass public static void createDb() throws IOException, DaoException, ClassNotFoundException, URISyntaxException {
  dbDir=File.createTempFile("String_Node_Str","String_Node_Str");
  dbDir.delete();
  dbDir.mkdirs();
  cacheFile=File.createTempFile("String_Node_Str","String_Node_Str");
  cacheFile.delete();
  cacheFile.mkdirs();
  WpDataSource ds=TestDaoUtil.getWpDataSource(dbDir);
  MetaInfoDao md=new MetaInfoSqlDao(ds);
  md.beginLoad();
  WikidataSqlDao wd=new WikidataSqlDao(ds);
  wd.beginLoad();
  WikidataDumpLoader loader=new WikidataDumpLoader(wd,md);
  URL url=TestWikidataDao.class.getResource("String_Node_Str");
  loader.load(new File(url.toURI()));
  wd.endLoad();
  md.endLoad();
}

Fixed version (ground truth):
@BeforeClass public static void createDb() throws IOException, DaoException, ClassNotFoundException, URISyntaxException {
  dbDir=File.createTempFile("String_Node_Str","String_Node_Str");
  dbDir.delete();
  dbDir.mkdirs();
  cacheFile=File.createTempFile("String_Node_Str","String_Node_Str");
  cacheFile.delete();
  cacheFile.mkdirs();
  WpDataSource ds=TestDaoUtil.getWpDataSource(dbDir);
  MetaInfoDao md=new MetaInfoSqlDao(ds);
  md.beginLoad();
  WikidataSqlDao wd=new WikidataSqlDao(ds,null,null);
  wd.beginLoad();
  WikidataDumpLoader loader=new WikidataDumpLoader(wd,md);
  URL url=TestWikidataDao.class.getResource("String_Node_Str");
  loader.load(new File(url.toURI()));
  wd.endLoad();
  md.endLoad();
}
Program: 52963
Project: 52963
Buggy source:
public static void main(String args[]) throws ClassNotFoundException, SQLException, IOException, ConfigurationException, WikapidiaException, DaoException {
  try {
    DateTime startDate=parseDate(args[1]);
    DateTime endDate=parseDate(args[2]);
    Env env=new EnvBuilder().setLanguages(args[0]).build();
    Configurator conf=env.getConfigurator();
    PageViewSqlDao dao=conf.get(PageViewSqlDao.class);
    final PageViewLoader loader=new PageViewLoader(env.getLanguages(),dao);
    LOG.log(Level.INFO,"String_Node_Str");
    dao.beginLoad();
    loader.load(startDate,endDate);
    LOG.log(Level.INFO,"String_Node_Str");
    dao.endLoad();
    LOG.log(Level.INFO,"String_Node_Str");
  }
 catch (  WikapidiaException wE) {
    System.err.println("String_Node_Str" + wE.getMessage());
    return;
  }
}

Fixed version (ground truth):
public static void main(String args[]) throws ClassNotFoundException, SQLException, IOException, ConfigurationException, WikapidiaException, DaoException {
  Options options=new Options();
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").create("String_Node_Str"));
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").isRequired().hasArg().create("String_Node_Str"));
  options.addOption(new DefaultOptionBuilder().withLongOpt("String_Node_Str").withDescription("String_Node_Str").isRequired().hasArg().create("String_Node_Str"));
  EnvBuilder.addStandardOptions(options);
  CommandLineParser parser=new PosixParser();
  CommandLine cmd;
  try {
    cmd=parser.parse(options,args);
  }
 catch (  ParseException e) {
    System.err.println("String_Node_Str" + e.getMessage());
    new HelpFormatter().printHelp("String_Node_Str",options);
    return;
  }
  String startTime=cmd.getOptionValue("String_Node_Str",null);
  String endTime=cmd.getOptionValue("String_Node_Str",null);
  try {
    DateTime startDate=parseDate(startTime);
    DateTime endDate=parseDate(endTime);
    Env env=new EnvBuilder(cmd).build();
    Configurator conf=env.getConfigurator();
    PageViewSqlDao dao=conf.get(PageViewSqlDao.class);
    final PageViewLoader loader=new PageViewLoader(env.getLanguages(),dao);
    if (cmd.hasOption("String_Node_Str")) {
      LOG.log(Level.INFO,"String_Node_Str");
      dao.clear();
    }
    LOG.log(Level.INFO,"String_Node_Str");
    dao.beginLoad();
    loader.load(startDate,endDate);
    LOG.log(Level.INFO,"String_Node_Str");
    dao.endLoad();
    LOG.log(Level.INFO,"String_Node_Str");
  }
 catch (  WikapidiaException wE) {
    System.err.println("String_Node_Str" + wE.getMessage());
    new HelpFormatter().printHelp("String_Node_Str",options);
    return;
  }
}
Program: 52964
Project: 52964
Buggy source:
/** 
 * Util function used to check if all hours in a given period have been parsed
 * @param startTime start time of a period
 * @param endTime end time of a period
 * @return
 */
boolean checkExist(DateTime startTime,DateTime endTime){
  for (DateTime hrTime=startTime; hrTime.getMillis() < endTime.getMillis(); hrTime.plusHours(1)) {
    if (!parsedHourSet.contains(hrTime.getMillis()))     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Util function used to check if all hours in a given period have been parsed
 * @param startTime start time of a period
 * @param endTime end time of a period
 * @return
 */
boolean checkExist(DateTime startTime,DateTime endTime){
  for (DateTime hrTime=startTime; hrTime.getMillis() < endTime.getMillis(); hrTime=hrTime.plusHours(1)) {
    if (!parsedHourSet.contains(hrTime.getMillis()))     return false;
  }
  return true;
}
Program: 52965
Project: 52965
Buggy source:
Map<Integer,Integer> getPageView(Iterable<Integer> ids,int startYear,int startMonth,int startDay,int startHour,int numHours) throws ConfigurationException, DaoException, WikapidiaException {
  Map<Integer,Integer> result=new HashMap<Integer,Integer>();
  DateTime startTime=new DateTime(startYear,startMonth,startDay,startHour,0);
  DateTime endTime=startTime.plusHours(numHours);
  if (!checkExist(startTime,endTime))   parse(startTime,numHours);
  for (  Integer id : ids) {
    if (db.exists(Integer.toString(id)) == false) {
      result.put(id,0);
      continue;
    }
    Map<Long,Integer> hourViewMap=db.getTreeMap(Integer.toString(id));
    int sum=0;
    for (DateTime hrTime=startTime; hrTime.getMillis() < endTime.getMillis(); hrTime.plusHours(1)) {
      if (hourViewMap.containsKey(hrTime.getMillis()) == false)       continue;
      sum+=hourViewMap.get(hrTime.getMillis());
    }
    result.put(id,sum);
  }
  return result;
}

Fixed version (ground truth):
Map<Integer,Integer> getPageView(Iterable<Integer> ids,int startYear,int startMonth,int startDay,int startHour,int numHours) throws ConfigurationException, DaoException, WikapidiaException {
  Map<Integer,Integer> result=new HashMap<Integer,Integer>();
  DateTime startTime=new DateTime(startYear,startMonth,startDay,startHour,0);
  DateTime endTime=startTime.plusHours(numHours);
  if (!checkExist(startTime,endTime))   parse(startTime,numHours);
  for (  Integer id : ids) {
    if (db.exists(Integer.toString(id)) == false) {
      result.put(id,0);
      continue;
    }
    Map<Long,Integer> hourViewMap=db.getTreeMap(Integer.toString(id));
    int sum=0;
    for (DateTime hrTime=startTime; hrTime.getMillis() < endTime.getMillis(); hrTime=hrTime.plusHours(1)) {
      if (hourViewMap.containsKey(hrTime.getMillis()) == false)       continue;
      sum+=hourViewMap.get(hrTime.getMillis());
    }
    result.put(id,sum);
  }
  return result;
}
Program: 52966
Project: 52966
Buggy source:
Map<Integer,Integer> getPageView(Iterable<Integer> ids,DateTime startTime,DateTime endTime) throws ConfigurationException, DaoException, WikapidiaException {
  Map<Integer,Integer> result=new HashMap<Integer,Integer>();
  if (!checkExist(startTime,endTime))   parse(startTime,endTime);
  for (  Integer id : ids) {
    if (db.exists(Integer.toString(id)) == false) {
      result.put(id,0);
      break;
    }
    Map<Long,Integer> hourViewMap=db.getTreeMap(Integer.toString(id));
    int sum=0;
    for (long hrTime=dateTimeToHour(startTime); hrTime < dateTimeToHour(endTime); hrTime+=1) {
      if (hourViewMap.containsKey(hrTime) == false)       continue;
      sum+=hourViewMap.get(hrTime);
    }
    result.put(id,sum);
  }
  return result;
}

Fixed version (ground truth):
Map<Integer,Integer> getPageView(Iterable<Integer> ids,DateTime startTime,DateTime endTime) throws ConfigurationException, DaoException, WikapidiaException {
  Map<Integer,Integer> result=new HashMap<Integer,Integer>();
  if (!checkExist(startTime,endTime))   parse(startTime,endTime);
  for (  Integer id : ids) {
    if (db.exists(Integer.toString(id)) == false) {
      result.put(id,0);
      continue;
    }
    Map<Long,Integer> hourViewMap=db.getTreeMap(Integer.toString(id));
    int sum=0;
    for (long hrTime=dateTimeToHour(startTime); hrTime < dateTimeToHour(endTime); hrTime+=1) {
      if (hourViewMap.containsKey(hrTime) == false)       continue;
      sum+=hourViewMap.get(hrTime);
    }
    result.put(id,sum);
  }
  return result;
}
Program: 52967
Project: 52967
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,4);
  int i=0;
  while (i < 4) {
    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) {
        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,4);
  int i=0;
  while (i < 4) {
    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: 52968
Project: 52968
Buggy source:
public void constructQueryUrl(){
  String http="String_Node_Str";
  String host="String_Node_Str";
  String queryUrl=http + lang.getLangCode() + host+ "String_Node_Str"+ outputFormat+ "String_Node_Str"+ queryAction+ "String_Node_Str"+ queryType+ "String_Node_Str"+ queryLimitPrefix+ "String_Node_Str";
  if (this.title != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ (pluralPage ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ title;
  }
  if (this.pageid != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ (pluralPage ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ pageid;
  }
  if ((this.redirects != null) && this.redirects) {
    queryUrl+="String_Node_Str";
  }
  if (this.filterredir != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ "String_Node_Str"+ filterredir;
  }
  if (this.from != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ "String_Node_Str"+ from;
  }
  if (this.namespace != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ "String_Node_Str"+ namespace;
  }
  if (this.prop != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ "String_Node_Str"+ prop;
  }
  this.queryUrl=queryUrl;
}

Fixed version (ground truth):
public void constructQueryUrl(){
  String http="String_Node_Str";
  String host="String_Node_Str";
  String queryUrl=http + lang.getLangCode() + host+ "String_Node_Str"+ outputFormat+ "String_Node_Str"+ queryAction+ "String_Node_Str"+ queryType+ "String_Node_Str"+ queryLimitPrefix+ "String_Node_Str";
  if (!this.titles.isEmpty()) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ (pluralPage ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ titles.get(0);
    for (int i=1; i < titles.size(); i++) {
      queryUrl+="String_Node_Str" + titles.get(i);
    }
  }
  if (!this.pageids.isEmpty()) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ (pluralPage ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ pageids.get(0);
    for (int i=1; i < pageids.size(); i++) {
      queryUrl+="String_Node_Str" + pageids.get(i);
    }
  }
  if ((this.redirects != null) && this.redirects) {
    queryUrl+="String_Node_Str";
  }
  if (this.filterredir != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ "String_Node_Str"+ filterredir;
  }
  if (this.from != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ "String_Node_Str"+ from;
  }
  if (this.namespace != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ "String_Node_Str"+ namespace;
  }
  if (this.prop != null) {
    queryUrl+="String_Node_Str" + queryInfoPrefix + "String_Node_Str"+ "String_Node_Str"+ prop;
  }
  this.queryUrl=queryUrl;
}