nus-yam/ex-repair huggingface dataset:
Program: 33292
Project: 33292
Buggy source:
/** 
 * We have to synchronize this method. Otherwise every experiment thread would check the file and try to download the data or try to use the file even the download hasn't been completed.
 */
@Override protected synchronized TopicDataset loadDataset() throws Exception {
  String nifFile=GerbilConfiguration.getInstance().getString(DATAHUB_DATASET_FILE_PROPERTY_NAME) + getName();
  logger.debug("String_Node_Str",nifFile);
  File f=new File(nifFile);
  if (!f.exists()) {
    logger.debug("String_Node_Str",nifFile);
    String data=rt.getForObject(datasetUrl,String.class);
    Path path=Paths.get(nifFile);
    Files.createDirectories(path.getParent());
    Path file=Files.createFile(path);
    Files.write(file,data.getBytes(),StandardOpenOption.WRITE);
  }
  return new FileBasedNIFDataset(wikiApi,nifFile,getName(),Lang.TTL);
}

Fixed version (ground truth):
/** 
 * We have to synchronize this method. Otherwise every experiment thread would check the file and try to download the data or try to use the file even the download hasn't been completed.
 */
@Override protected synchronized TopicDataset loadDataset() throws Exception {
  String nifFile=GerbilConfiguration.getInstance().getString(DATAHUB_DATASET_FILE_PROPERTY_NAME) + getName();
  logger.debug("String_Node_Str",nifFile);
  File f=new File(nifFile);
  if (!f.exists()) {
    logger.debug("String_Node_Str",nifFile);
    String data=rt.getForObject(datasetUrl,String.class);
    Path path=Paths.get(nifFile);
    Files.createDirectories(path.getParent());
    Path file=Files.createFile(path);
    Files.write(file,data.getBytes(),StandardOpenOption.WRITE);
  }
  FileBasedNIFDataset dataset=new FileBasedNIFDataset(wikiApi,nifFile,getName(),Lang.TTL);
  dataset.init();
  return dataset;
}
Program: 33293
Project: 33293
Buggy source:
private synchronized static AnnotatorMapping getInstance(){
  if (instance == null) {
    Map<String,AnnotatorConfiguration> mapping=new HashMap<String,AnnotatorConfiguration>();
    mapping.put(BabelfyAnnotatorConfig.ANNOTATOR_NAME,new BabelfyAnnotatorConfig(SingletonWikipediaApi.getInstance()));
    mapping.put(BabelfyAnnotatorConfig.ANNOTATOR_NAME_OPT_FOR_SHORT_TEXTS,new BabelfyAnnotatorConfig(SingletonWikipediaApi.getInstance(),true));
    mapping.put(SpotlightAnnotatorConfig.ANNOTATOR_NAME,new SpotlightAnnotatorConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi()));
    mapping.put(TagMeAnnotatorConfig.ANNOTATOR_NAME,new TagMeAnnotatorConfig());
    mapping.put(WATAnnotatorConfig.ANNOTATOR_NAME,new WATAnnotatorConfig());
    mapping.put(WikipediaMinerAnnotatorConfig.ANNOTATOR_NAME,new WikipediaMinerAnnotatorConfig());
    mapping.put(AgdistisAnnotatorConfig.ANNOTATOR_NAME,new AgdistisAnnotatorConfig(SingletonWikipediaApi.getInstance()));
    mapping.put(NERDAnnotatorConfig.ANNOTATOR_NAME,new NERDAnnotatorConfig(SingletonWikipediaApi.getInstance()));
    mapping.put(FOXAnnotator.NAME,new FOXAnnotatorConfig(SingletonWikipediaApi.getInstance()));
    mapping.put(KeaAnnotatorConfig.ANNOTATOR_NAME,new KeaAnnotatorConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi()));
    instance=new AnnotatorMapping(mapping);
  }
  return instance;
}

Fixed version (ground truth):
private synchronized static AnnotatorMapping getInstance(){
  if (instance == null) {
    Map<String,AnnotatorConfiguration> mapping=new HashMap<String,AnnotatorConfiguration>();
    mapping.put(BabelfyAnnotatorConfig.ANNOTATOR_NAME,new BabelfyAnnotatorConfig(SingletonWikipediaApi.getInstance()));
    mapping.put(SpotlightAnnotatorConfig.ANNOTATOR_NAME,new SpotlightAnnotatorConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi()));
    mapping.put(TagMeAnnotatorConfig.ANNOTATOR_NAME,new TagMeAnnotatorConfig());
    mapping.put(WATAnnotatorConfig.ANNOTATOR_NAME,new WATAnnotatorConfig());
    mapping.put(WikipediaMinerAnnotatorConfig.ANNOTATOR_NAME,new WikipediaMinerAnnotatorConfig());
    mapping.put(AgdistisAnnotatorConfig.ANNOTATOR_NAME,new AgdistisAnnotatorConfig(SingletonWikipediaApi.getInstance()));
    mapping.put(NERDAnnotatorConfig.ANNOTATOR_NAME,new NERDAnnotatorConfig(SingletonWikipediaApi.getInstance()));
    mapping.put(FOXAnnotator.NAME,new FOXAnnotatorConfig(SingletonWikipediaApi.getInstance()));
    mapping.put(KeaAnnotatorConfig.ANNOTATOR_NAME,new KeaAnnotatorConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi()));
    instance=new AnnotatorMapping(mapping);
  }
  return instance;
}
Program: 33294
Project: 33294
Buggy source:
@Override protected TopicSystem loadAnnotator(ExperimentType type) throws Exception {
  String configFile=GerbilConfiguration.getInstance().getString(BABELNET_CONFIG_FILE_PROPERTY_NAME);
  if (configFile == null) {
    throw new IOException("String_Node_Str" + BABELNET_CONFIG_FILE_PROPERTY_NAME + "String_Node_Str");
  }
  BabelNetConfiguration.getInstance().setConfigurationFile(new File(configFile));
  String key=GerbilConfiguration.getInstance().getString(BABELFY_WEB_SERVICE_KEY_PROPERTY_NAME);
  if (key == null) {
    return new BabelfyAnnotator(wikiApi);
  }
 else {
    return new BabelfyAnnotator(key,wikiApi);
  }
}

Fixed version (ground truth):
@Override protected TopicSystem loadAnnotator(ExperimentType type) throws Exception {
  String configFile=GerbilConfiguration.getInstance().getString(BABELNET_CONFIG_FILE_PROPERTY_NAME);
  if (configFile == null) {
    throw new IOException("String_Node_Str" + BABELNET_CONFIG_FILE_PROPERTY_NAME + "String_Node_Str");
  }
  BabelNetConfiguration.getInstance().setConfigurationFile(new File(configFile));
  String key=GerbilConfiguration.getInstance().getString(BABELFY_WEB_SERVICE_KEY_PROPERTY_NAME);
  if (key == null) {
    return new BabelfyAnnotator(wikiApi,optimizedForShortTexts);
  }
 else {
    return new BabelfyAnnotator(key,wikiApi,optimizedForShortTexts);
  }
}
Program: 33295
Project: 33295
Buggy source:
protected static HashSet<Tag> solveC2W(AbstractErrorCounter errorCounter,String text) throws AnnotationException {
  try {
    return ((C2WSystem)errorCounter.getDecoratedAnnotator()).solveC2W(text);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
    return new HashSet<Tag>(0);
  }
}

Fixed version (ground truth):
protected static HashSet<Tag> solveC2W(AbstractErrorCounter errorCounter,String text) throws AnnotationException {
  HashSet<Tag> result=null;
  try {
    result=((C2WSystem)errorCounter.getDecoratedAnnotator()).solveC2W(text);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
    return new HashSet<Tag>(0);
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder builder=new StringBuilder();
    builder.append('[');
    builder.append(errorCounter.getName());
    builder.append("String_Node_Str");
    boolean first=true;
    for (    Tag a : result) {
      if (first) {
        first=false;
      }
 else {
        builder.append(',');
      }
      builder.append("String_Node_Str");
      builder.append(a.getConcept());
      builder.append(')');
    }
    builder.append(']');
    LOGGER.debug(builder.toString());
  }
  return result;
}
Program: 33296
Project: 33296
Buggy source:
protected static HashSet<Annotation> solveD2W(AbstractErrorCounter errorCounter,String text,HashSet<Mention> mentions){
  HashSet<Annotation> result=null;
  try {
    result=((D2WSystem)errorCounter.getDecoratedAnnotator()).solveD2W(text,mentions);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder builder=new StringBuilder();
    builder.append('[');
    builder.append(errorCounter.getName());
    builder.append("String_Node_Str");
    boolean first=true;
    for (    Annotation a : result) {
      if (first) {
        first=false;
      }
 else {
        builder.append(',');
      }
      builder.append("String_Node_Str");
      builder.append(a.getPosition());
      builder.append("String_Node_Str");
      builder.append(a.getLength());
      builder.append("String_Node_Str");
      builder.append(a.getConcept());
      builder.append(')');
    }
    builder.append(']');
    LOGGER.debug(builder.toString());
  }
  return result;
}

Fixed version (ground truth):
protected static HashSet<Annotation> solveD2W(AbstractErrorCounter errorCounter,String text,HashSet<Mention> mentions){
  HashSet<Annotation> result=null;
  try {
    result=((D2WSystem)errorCounter.getDecoratedAnnotator()).solveD2W(text,mentions);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
    return new HashSet<Annotation>(0);
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder builder=new StringBuilder();
    builder.append('[');
    builder.append(errorCounter.getName());
    builder.append("String_Node_Str");
    boolean first=true;
    for (    Annotation a : result) {
      if (first) {
        first=false;
      }
 else {
        builder.append(',');
      }
      builder.append("String_Node_Str");
      builder.append(a.getPosition());
      builder.append("String_Node_Str");
      builder.append(a.getLength());
      builder.append("String_Node_Str");
      builder.append(a.getConcept());
      builder.append(')');
    }
    builder.append(']');
    LOGGER.debug(builder.toString());
  }
  return result;
}
Program: 33298
Project: 33298
Buggy source:
public static MatchRelation<Annotation> createMatchRelation(WikipediaApiInterface wikiApi,Matching matching,ExperimentType type){
switch (matching) {
case WEAK_ANNOTATION_MATCH:
{
      if (type.equalsOrContainsType(ExperimentType.A2W)) {
        return new WeakAnnotationMatch(wikiApi);
      }
      break;
    }
case STRONG_ANNOTATION_MATCH:
{
    if (type.equalsOrContainsType(ExperimentType.D2W)) {
      return new StrongAnnotationMatch(wikiApi);
    }
    break;
  }
case STRONG_ENTITY_MATCH:
{
  if (ExperimentType.Sc2W.equalsOrContainsType(type)) {
    return new ConceptAnnotationMatch(wikiApi);
  }
  break;
}
}
return null;
}

Fixed version (ground truth):
public static MatchRelation<? extends Tag> createMatchRelation(WikipediaApiInterface wikiApi,Matching matching,ExperimentType type){
switch (matching) {
case WEAK_ANNOTATION_MATCH:
{
      if (type.equalsOrContainsType(ExperimentType.A2W)) {
        return new WeakAnnotationMatch(wikiApi);
      }
      break;
    }
case STRONG_ANNOTATION_MATCH:
{
    if (type.equalsOrContainsType(ExperimentType.D2W)) {
      return new StrongAnnotationMatch(wikiApi);
    }
    break;
  }
case STRONG_ENTITY_MATCH:
{
  if (ExperimentType.Sc2W.equalsOrContainsType(type)) {
    return new StrongTagMatch(wikiApi);
  }
  break;
}
}
return null;
}
Program: 33299
Project: 33299
Buggy source:
protected Set<Annotation> fox(String text){
  Set<Annotation> set=new HashSet<>();
  try {
    FoxResponse response=fox.setInput(text).setLightVersion(FoxParameter.FOXLIGHT.OFF).setOutputFormat(FoxParameter.OUTPUT.JSONLD).setTask(FoxParameter.TASK.NER).send();
    if (response != null && response.getOutput() != null) {
      JSONObject outObj=new JSONObject(response.getOutput());
      if (outObj.has("String_Node_Str")) {
        JSONArray graph=outObj.getJSONArray("String_Node_Str");
        for (int i=0; i < graph.length(); i++) {
          JSONObject entity=graph.getJSONObject(i);
          if (entity != null && entity.has("String_Node_Str") && entity.has("String_Node_Str") && entity.has("String_Node_Str")) {
            String uri=entity.getString("String_Node_Str");
            String body=entity.getString("String_Node_Str");
            Object begin=entity.get("String_Node_Str");
            String urlDecoded=URLDecoder.decode(uri,"String_Node_Str");
            int id=DBpediaToWikiId.getId(wikiApi,urlDecoded);
            if (id > -1) {
              if (begin instanceof JSONArray) {
                for (int ii=0; ii < ((JSONArray)begin).length(); ii++) {
                  int b=Integer.valueOf(((JSONArray)begin).getString(ii));
                  set.add(new Annotation(b,b + body.length(),id));
                }
              }
 else               if (begin instanceof String) {
                int b=Integer.valueOf((String)begin);
                set.add(new Annotation(b,b + body.length(),id));
              }
 else               if (LOG.isDebugEnabled())               LOG.debug("String_Node_Str");
            }
 else             if (LOG.isDebugEnabled())             LOG.debug("String_Node_Str".concat(uri));
          }
        }
      }
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + set.size());
  return set;
}

Fixed version (ground truth):
protected Set<Annotation> fox(String text){
  if (LOG.isTraceEnabled())   LOG.trace(text);
  Set<Annotation> set=new HashSet<>();
  try {
    FoxResponse response=fox.setInput(text).setLightVersion(FoxParameter.FOXLIGHT.OFF).setOutputFormat(FoxParameter.OUTPUT.JSONLD).setTask(FoxParameter.TASK.NER).send();
    if (response != null && response.getOutput() != null) {
      JSONObject outObj=new JSONObject(response.getOutput());
      if (outObj.has("String_Node_Str")) {
        JSONArray graph=outObj.getJSONArray("String_Node_Str");
        for (int i=0; i < graph.length(); i++)         set.addAll(add(graph.getJSONObject(i)));
      }
 else       set.addAll(add(outObj));
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + set.size());
  return set;
}
Program: 33300
Project: 33300
Buggy source:
public void setLastCreatedID(String id){
  try {
    int year=Integer.parseInt(id.substring(0,4));
    int month=Integer.parseInt(id.substring(4,6));
    int day=Integer.parseInt(id.substring(6,8));
    int count=Integer.parseInt(id.substring(8));
    this.count=count + 1;
    lastTimeStamp.set(Calendar.YEAR,year);
    lastTimeStamp.set(Calendar.MONTH,month);
    lastTimeStamp.set(Calendar.DAY_OF_MONTH,day);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void setLastCreatedID(String id){
  try {
    int year=Integer.parseInt(id.substring(0,4));
    int month=Integer.parseInt(id.substring(4,6));
    int day=Integer.parseInt(id.substring(6,8));
    int count=Integer.parseInt(id.substring(8));
    this.count=count + 1;
    lastTimeStamp.set(year,Calendar.JANUARY + (month - 1),day,0,0,0);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 33301
Project: 33301
Buggy source:
private IDCreator(){
  count=0;
  lastTimeStamp=Calendar.getInstance();
  lastTimeStamp.set(Calendar.HOUR,0);
  lastTimeStamp.set(Calendar.MINUTE,0);
  lastTimeStamp.set(Calendar.SECOND,0);
  lastTimeStamp.set(Calendar.MILLISECOND,0);
}

Fixed version (ground truth):
private IDCreator(){
  count=0;
  lastTimeStamp=Calendar.getInstance();
  lastTimeStamp.set(Calendar.HOUR_OF_DAY,0);
  lastTimeStamp.set(Calendar.MINUTE,0);
  lastTimeStamp.set(Calendar.SECOND,0);
  lastTimeStamp.set(Calendar.MILLISECOND,0);
}
Program: 33302
Project: 33302
Buggy source:
private synchronized int getCount(Calendar timestamp){
  if ((timestamp.get(Calendar.YEAR) == lastTimeStamp.get(Calendar.YEAR)) && (timestamp.get(Calendar.DAY_OF_YEAR) == lastTimeStamp.get(Calendar.DAY_OF_YEAR))) {
    return count++;
  }
 else {
    lastTimeStamp.set(Calendar.DAY_OF_YEAR,timestamp.get(Calendar.DAY_OF_YEAR));
    lastTimeStamp.set(Calendar.YEAR,timestamp.get(Calendar.YEAR));
    count=1;
    return 0;
  }
}

Fixed version (ground truth):
private synchronized int getCount(Calendar timestamp){
  if ((timestamp.get(Calendar.YEAR) == lastTimeStamp.get(Calendar.YEAR)) && (timestamp.get(Calendar.MONTH) == lastTimeStamp.get(Calendar.MONTH)) && (timestamp.get(Calendar.DAY_OF_MONTH) == lastTimeStamp.get(Calendar.DAY_OF_MONTH))) {
    return count++;
  }
 else {
    lastTimeStamp.set(timestamp.get(Calendar.YEAR),timestamp.get(Calendar.MONTH),timestamp.get(Calendar.DAY_OF_MONTH));
    count=1;
    return 0;
  }
}
Program: 33303
Project: 33303
Buggy source:
@Override public synchronized int connectCachedResultOrCreateTask(String annotatorName,String datasetName,String experimentType,String matching,String experimentId){
  int experimentTaskId=getCachedExperimentTaskId(annotatorName,datasetName,experimentType,matching);
  if (experimentTaskId == EXPERIMENT_TASK_NOT_CACHED) {
    experimentTaskId=createTask(annotatorName,datasetName,experimentType,matching,experimentId);
  }
 else {
    connectExistingTaskWithExperiment(experimentTaskId,experimentId);
  }
  return experimentTaskId;
}

Fixed version (ground truth):
@Override public synchronized int connectCachedResultOrCreateTask(String annotatorName,String datasetName,String experimentType,String matching,String experimentId){
  int experimentTaskId=EXPERIMENT_TASK_NOT_CACHED;
  if (resultDurability > 0) {
    experimentTaskId=getCachedExperimentTaskId(annotatorName,datasetName,experimentType,matching);
  }
 else {
    LOGGER.warn("String_Node_Str");
  }
  if (experimentTaskId == EXPERIMENT_TASK_NOT_CACHED) {
    return createTask(annotatorName,datasetName,experimentType,matching,experimentId);
  }
 else {
    LOGGER.debug("String_Node_Str" + experimentTaskId + "String_Node_Str");
    connectExistingTaskWithExperiment(experimentTaskId,experimentId);
    return CACHED_EXPERIMENT_TASK_CAN_BE_USED;
  }
}
Program: 33304
Project: 33304
Buggy source:
public ExperimentDAOImpl(DataSource dataSource){
  this.template=new NamedParameterJdbcTemplate(dataSource);
}

Fixed version (ground truth):
public ExperimentDAOImpl(DataSource dataSource,long resultDurability){
  super(resultDurability);
  this.template=new NamedParameterJdbcTemplate(dataSource);
}
Program: 33305
Project: 33305
Buggy source:
@Override public void addResourceHandlers(ResourceHandlerRegistry registry){
  registry.addResourceHandler("String_Node_Str").addResourceLocations("String_Node_Str");
}

Fixed version (ground truth):
@Override public void addResourceHandlers(ResourceHandlerRegistry registry){
  registry.addResourceHandler("String_Node_Str").addResourceLocations("String_Node_Str");
  registry.addResourceHandler("String_Node_Str").addResourceLocations("String_Node_Str");
}
Program: 33306
Project: 33306
Buggy source:
public static it.acubelab.batframework.data.Annotation translateAnnotation2BatAnnotation(Annotation annotation){
  int wikiId=-1;
  if (annotation instanceof DisambiguatedAnnotation) {
    DBpediaToWikiId.getId(((DisambiguatedAnnotation)annotation).getUri());
  }
  return new it.acubelab.batframework.data.Annotation(annotation.getStartPosition(),annotation.getLength(),wikiId);
}

Fixed version (ground truth):
public static it.acubelab.batframework.data.Annotation translateAnnotation2BatAnnotation(Annotation annotation){
  int wikiId=-1;
  if (annotation instanceof DisambiguatedAnnotation) {
    wikiId=DBpediaToWikiId.getId(((DisambiguatedAnnotation)annotation).getUri());
  }
  return new it.acubelab.batframework.data.Annotation(annotation.getStartPosition(),annotation.getLength(),wikiId);
}
Program: 33307
Project: 33307
Buggy source:
public static void main(String[] args) throws FileNotFoundException, ClassNotFoundException, IOException {
  WikipediaApiInterface wikiAPI=SingletonWikipediaApi.getInstance();
  ExperimentTaskConfiguration taskConfigs[]=new ExperimentTaskConfiguration[]{new ExperimentTaskConfiguration(new NIFWebserviceAnnotatorConfiguration(ANNOTATOR_URL,ANNOTATOR_NAME,false,ExperimentType.D2W),new KnownNIFFileDatasetConfig(NIFDatasets.KORE50),ExperimentType.D2W,Matching.STRONG_ANNOTATION_MATCH)};
  Experimenter experimenter=new Experimenter(wikiAPI,new SimpleLoggingDAO4Debugging(),taskConfigs,"String_Node_Str");
  experimenter.run();
}

Fixed version (ground truth):
public static void main(String[] args) throws FileNotFoundException, ClassNotFoundException, IOException {
  WikipediaApiInterface wikiAPI=SingletonWikipediaApi.getInstance();
  DBPediaApi dbpApi=new DBPediaApi();
  ExperimentTaskConfiguration taskConfigs[]=new ExperimentTaskConfiguration[]{new ExperimentTaskConfiguration(new NIFWebserviceAnnotatorConfiguration(ANNOTATOR_URL,ANNOTATOR_NAME,false,ExperimentType.D2W),new KnownNIFFileDatasetConfig(NIFDatasets.KORE50),ExperimentType.D2W,Matching.STRONG_ANNOTATION_MATCH),new ExperimentTaskConfiguration(new SpotlightAnnotatorConfig(wikiAPI,dbpApi),new KnownNIFFileDatasetConfig(NIFDatasets.KORE50),ExperimentType.D2W,Matching.STRONG_ANNOTATION_MATCH)};
  Experimenter experimenter=new Experimenter(wikiAPI,new SimpleLoggingDAO4Debugging(),taskConfigs,"String_Node_Str");
  experimenter.run();
}
Program: 33308
Project: 33308
Buggy source:
@Parameters public static List<Object[]> data(){
  return Arrays.asList(new Object[][]{{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new AnnotationImpl(13,8)))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new AnnotationImpl(0,4)))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList(((Annotation)new AnnotationImpl(0,4)),(Annotation)new AnnotationImpl(13,8)))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new DisambiguatedAnnotation(13,8,"String_Node_Str")))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new ScoredDisambigAnnotation(13,8,"String_Node_Str",0.87)))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new AnnotationImpl(3,4),(Annotation)new ScoredDisambigAnnotation(19,8,"String_Node_Str",0.87)))}});
}

Fixed version (ground truth):
@Parameters public static List<Object[]> data(){
  return Arrays.asList(new Object[][]{{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new AnnotationImpl(13,8)))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new AnnotationImpl(0,4)))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList(((Annotation)new AnnotationImpl(0,4)),(Annotation)new AnnotationImpl(13,8)))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new DisambiguatedAnnotation(13,8,"String_Node_Str")))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new ScoredDisambigAnnotation(13,8,"String_Node_Str",0.87)))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new AnnotationImpl(3,4),(Annotation)new AnnotationImpl(19,8)))},{new AnnotatedDocumentImpl("String_Node_Str","String_Node_Str",Arrays.asList((Annotation)new AnnotationImpl(21,3),(Annotation)new AnnotationImpl(0,8),(Annotation)new AnnotationImpl(42,4)))}});
}
Program: 33309
Project: 33309
Buggy source:
@Test public void test() throws Exception {
  NIFDocumentCreator creator=new TurtleNIFDocumentCreator();
  String nifDocument=creator.getDocumentAsNIFString(document);
  NIFDocumentParser parser=new TurtleNIFDocumentParser();
  AnnotatedDocument newDocument=parser.getDocumentFromNIFString(nifDocument);
  Assert.assertEquals("String_Node_Str" + nifDocument,document,newDocument);
}

Fixed version (ground truth):
@Test public void test() throws Exception {
  NIFDocumentCreator creator=new TurtleNIFDocumentCreator();
  String nifDocument=creator.getDocumentAsNIFString(document);
  NIFDocumentParser parser=new TurtleNIFDocumentParser();
  AnnotatedDocument newDocument=parser.getDocumentFromNIFString(nifDocument);
  Assert.assertEquals("String_Node_Str" + document.toString() + "String_Node_Str"+ newDocument.toString()+ "String_Node_Str"+ nifDocument,document.getDocumentURI(),newDocument.getDocumentURI());
  Assert.assertEquals("String_Node_Str" + document.toString() + "String_Node_Str"+ newDocument.toString()+ "String_Node_Str"+ nifDocument,document.getText(),newDocument.getText());
  List<Annotation> expectedAnnotations=document.getAnnotations();
  List<Annotation> receivedAnnotations=newDocument.getAnnotations();
  Assert.assertEquals("String_Node_Str" + document.toString() + "String_Node_Str"+ newDocument.toString()+ "String_Node_Str"+ nifDocument,expectedAnnotations.size(),receivedAnnotations.size());
  for (  Annotation annotation : expectedAnnotations) {
    Assert.assertTrue("String_Node_Str" + document.toString() + "String_Node_Str"+ newDocument.toString()+ "String_Node_Str"+ nifDocument,receivedAnnotations.contains(annotation));
  }
}
Program: 33310
Project: 33310
Buggy source:
private synchronized static AnnotatorName2ExperimentTypeMapping getInstance(){
  if (instance == null) {
    Map<String,ExperimentType> mapping=new HashMap<String,ExperimentType>();
    mapping.put(BabelfyAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    mapping.put(NIFWebserviceAnnotatorConfiguration.ANNOTATOR_NAME,ExperimentType.Sa2W);
    mapping.put(SpotlightAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    mapping.put(TagMeAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    mapping.put(WikipediaMinerAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    mapping.put(AgdistisAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    instance=new AnnotatorName2ExperimentTypeMapping(mapping);
  }
  return instance;
}

Fixed version (ground truth):
private synchronized static AnnotatorName2ExperimentTypeMapping getInstance(){
  if (instance == null) {
    Map<String,ExperimentType> mapping=new HashMap<String,ExperimentType>();
    mapping.put(BabelfyAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    mapping.put(SpotlightAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    mapping.put(TagMeAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    mapping.put(WikipediaMinerAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    mapping.put(AgdistisAnnotatorConfig.ANNOTATOR_NAME,ExperimentType.Sa2W);
    instance=new AnnotatorName2ExperimentTypeMapping(mapping);
  }
  return instance;
}
Program: 33311
Project: 33311
Buggy source:
public void setLastCreatedID(String id){
  try {
    int year=Integer.parseInt(id.substring(0,4));
    int month=Integer.parseInt(id.substring(4,6));
    int day=Integer.parseInt(id.substring(6,8));
    int count=Integer.parseInt(id.substring(8));
    this.count=count;
    lastTimeStamp.set(Calendar.YEAR,year);
    lastTimeStamp.set(Calendar.MONTH,month);
    lastTimeStamp.set(Calendar.DAY_OF_MONTH,day);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void setLastCreatedID(String id){
  try {
    int year=Integer.parseInt(id.substring(0,4));
    int month=Integer.parseInt(id.substring(4,6));
    int day=Integer.parseInt(id.substring(6,8));
    int count=Integer.parseInt(id.substring(8));
    this.count=count + 1;
    lastTimeStamp.set(Calendar.YEAR,year);
    lastTimeStamp.set(Calendar.MONTH,month);
    lastTimeStamp.set(Calendar.DAY_OF_MONTH,day);
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 33312
Project: 33312
Buggy source:
@Override protected TopicSystem loadAnnotator() throws Exception {
  return new NIFBasedAnnotatorWebservice(annotaturURL,this.getAnnotatorName());
}

Fixed version (ground truth):
@Override protected TopicSystem loadAnnotator() throws Exception {
  return new NIFBasedAnnotatorWebservice(annotaturURL,this.getAnnotatorName(),wikiApi,dbpediaApi);
}
Program: 33313
Project: 33313
Buggy source:
public NIFWebserviceAnnotatorConfiguration(String annotaturURL,String annotatorName,boolean couldBeCached,ExperimentType... applicableForExperiment){
  super(annotatorName,false,applicableForExperiment);
  this.annotaturURL=annotaturURL;
}

Fixed version (ground truth):
public NIFWebserviceAnnotatorConfiguration(String annotaturURL,String annotatorName,boolean couldBeCached,WikipediaApiInterface wikiApi,DBPediaApi dbpediaApi,ExperimentType... applicableForExperiment){
  super(annotatorName,false,applicableForExperiment);
  this.annotaturURL=annotaturURL;
  this.wikiApi=wikiApi;
  this.dbpediaApi=dbpediaApi;
}
Program: 33314
Project: 33314
Buggy source:
public static AnnotatedDocument createAnnotatedDocument(String text,HashSet<Mention> mentions){
  List<Annotation> annotations=new ArrayList<Annotation>();
  for (  Mention mention : mentions) {
    annotations.add(translateMention2Annotation(mention));
  }
  return new AnnotatedDocumentImpl(text,annotations);
}

Fixed version (ground truth):
public static AnnotatedDocument createAnnotatedDocument(String text,HashSet<Mention> mentions){
  List<Annotation> annotations=new ArrayList<Annotation>();
  if (mentions != null) {
    for (    Mention mention : mentions) {
      annotations.add(translateMention2Annotation(mention));
    }
  }
  return new AnnotatedDocumentImpl(text,annotations);
}
Program: 33315
Project: 33315
Buggy source:
public static HashSet<it.acubelab.batframework.data.Annotation> createAnnotations(AnnotatedDocument document){
  List<Annotation> annotations=document.getAnnotations();
  HashSet<it.acubelab.batframework.data.Annotation> batAnnotations=new HashSet<it.acubelab.batframework.data.Annotation>();
  for (  Annotation annotation : annotations) {
    batAnnotations.add(translateAnnotation2BatAnnotation(annotation));
  }
  return batAnnotations;
}

Fixed version (ground truth):
public static HashSet<it.acubelab.batframework.data.Annotation> createAnnotations(WikipediaApiInterface wikiApi,DBPediaApi dbpediaApi,AnnotatedDocument document){
  List<Annotation> annotations=document.getAnnotations();
  HashSet<it.acubelab.batframework.data.Annotation> batAnnotations=new HashSet<it.acubelab.batframework.data.Annotation>();
  for (  Annotation annotation : annotations) {
    batAnnotations.add((it.acubelab.batframework.data.Annotation)translateAnnotation2BatAnnotation(wikiApi,dbpediaApi,annotation));
  }
  return batAnnotations;
}
Program: 33316
Project: 33316
Buggy source:
public static it.acubelab.batframework.data.Annotation translateAnnotation2BatAnnotation(Annotation annotation){
  int wikiId=-1;
  if (annotation instanceof DisambiguatedAnnotation) {
    wikiId=DBpediaToWikiId.getId(((DisambiguatedAnnotation)annotation).getUri());
  }
  return new it.acubelab.batframework.data.Annotation(annotation.getStartPosition(),annotation.getLength(),wikiId);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected static <T extends Tag>T translateAnnotation2BatAnnotation(WikipediaApiInterface wikiApi,DBPediaApi dbpediaApi,Annotation annotation){
  String wikipediaTitle=null;
  if (annotation instanceof DisambiguatedAnnotation) {
    wikipediaTitle=dbpediaApi.dbpediaToWikipedia(((DisambiguatedAnnotation)annotation).getUri().replace("String_Node_Str","String_Node_Str"));
    int wikiId=-1;
    if (wikipediaTitle != null) {
      try {
        wikiId=wikiApi.getIdByTitle(wikipediaTitle);
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str");
      }
    }
    System.out.println(((DisambiguatedAnnotation)annotation).getUri() + "String_Node_Str" + wikiId);
    if (annotation instanceof ScoredDisambigAnnotation) {
      return (T)new ScoredAnnotation(annotation.getStartPosition(),annotation.getLength(),wikiId,(float)((ScoredDisambigAnnotation)annotation).getConfidence());
    }
 else {
      return (T)new it.acubelab.batframework.data.Annotation(annotation.getStartPosition(),annotation.getLength(),wikiId);
    }
  }
 else {
    return null;
  }
}
Program: 33317
Project: 33317
Buggy source:
public NIFBasedAnnotatorWebservice(String url,String name){
  this.url=url;
  this.name=name;
  client=HttpClients.createDefault();
}

Fixed version (ground truth):
public NIFBasedAnnotatorWebservice(String url,String name,WikipediaApiInterface wikiApi,DBPediaApi dbpediaApi){
  this.url=url;
  this.name=name;
  this.wikiApi=wikiApi;
  this.dbpediaApi=dbpediaApi;
  client=HttpClients.createDefault();
}
Program: 33318
Project: 33318
Buggy source:
@Override public HashSet<Annotation> solveD2W(String text,HashSet<Mention> mentions) throws AnnotationException {
  AnnotatedDocument document=BAT2NIF_TranslationHelper.createAnnotatedDocument(text,mentions);
  document.setDocumentURI(DOCUMENT_URI + documentCount);
  ++documentCount;
  String nifDocument=nifCreator.getDocumentAsNIFString(document);
  HttpEntity entity=null;
  try {
    entity=new StringEntity(nifDocument,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    LOGGER.error("String_Node_Str",e);
    throw new AnnotationException("String_Node_Str" + e.getLocalizedMessage());
  }
  lastRequestSend=System.currentTimeMillis();
  HttpPost request=new HttpPost(url);
  request.setEntity(entity);
  request.addHeader("String_Node_Str",nifCreator.getHttpContentType());
  request.addHeader("String_Node_Str",nifParser.getHttpContentType());
  entity=null;
  CloseableHttpResponse response=null;
  InputStreamReader reader=null;
  try {
    try {
      response=client.execute(request);
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new AnnotationException("String_Node_Str" + e.getLocalizedMessage());
    }
    StatusLine status=response.getStatusLine();
    if ((status.getStatusCode() < 200) || (status.getStatusCode() >= 300)) {
      LOGGER.error("String_Node_Str" + status.toString());
      throw new AnnotationException("String_Node_Str" + status.toString());
    }
    entity=response.getEntity();
    lastResponseReceived=System.currentTimeMillis();
    try {
      reader=new InputStreamReader(entity.getContent());
      document=nifParser.getDocumentFromNIFReader(reader);
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new AnnotationException("String_Node_Str" + e.getLocalizedMessage());
    }
  }
  finally {
    if (reader != null) {
      try {
        reader.close();
      }
 catch (      IOException e) {
      }
    }
    if (entity != null) {
      try {
        EntityUtils.consume(entity);
      }
 catch (      IOException e1) {
      }
    }
    if (response != null) {
      try {
        response.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return NIF2BAT_TranslationHelper.createAnnotations(document);
}

Fixed version (ground truth):
@Override public HashSet<Annotation> solveD2W(String text,HashSet<Mention> mentions) throws AnnotationException {
  AnnotatedDocument document=BAT2NIF_TranslationHelper.createAnnotatedDocument(text,mentions);
  document=request(document);
  return NIF2BAT_TranslationHelper.createAnnotations(wikiApi,dbpediaApi,document);
}
Program: 33319
Project: 33319
Buggy source:
public static AnnotatorConfiguration getAnnotatorConfig(String name){
switch (name) {
case BabelfyAnnotatorConfig.ANNOTATOR_NAME:
    return new BabelfyAnnotatorConfig();
case NIFWebserviceAnnotatorConfiguration.ANNOTATOR_NAME:
  return new NIFWebserviceAnnotatorConfiguration(null,name,false,ExperimentType.Sa2W);
case SpotlightAnnotatorConfig.ANNOTATOR_NAME:
return new SpotlightAnnotatorConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi());
case TagMeAnnotatorConfig.ANNOTATOR_NAME:
return new TagMeAnnotatorConfig();
case WikipediaMinerAnnotatorConfig.ANNOTATOR_NAME:
return new WikipediaMinerAnnotatorConfig();
case AgdistisAnnotatorConfig.ANNOTATOR_NAME:
return new AgdistisAnnotatorConfig(SingletonWikipediaApi.getInstance());
default :
return null;
}
}

Fixed version (ground truth):
public static AnnotatorConfiguration getAnnotatorConfig(String name){
switch (name) {
case BabelfyAnnotatorConfig.ANNOTATOR_NAME:
    return new BabelfyAnnotatorConfig();
case NIFWebserviceAnnotatorConfiguration.ANNOTATOR_NAME:
  return new NIFWebserviceAnnotatorConfiguration(null,name,false,SingletonWikipediaApi.getInstance(),new DBPediaApi(),ExperimentType.Sa2W);
case SpotlightAnnotatorConfig.ANNOTATOR_NAME:
return new SpotlightAnnotatorConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi());
case TagMeAnnotatorConfig.ANNOTATOR_NAME:
return new TagMeAnnotatorConfig();
case WikipediaMinerAnnotatorConfig.ANNOTATOR_NAME:
return new WikipediaMinerAnnotatorConfig();
case AgdistisAnnotatorConfig.ANNOTATOR_NAME:
return new AgdistisAnnotatorConfig(SingletonWikipediaApi.getInstance());
default :
return null;
}
}
Program: 33320
Project: 33320
Buggy source:
private synchronized int getCount(Calendar timestamp){
  if ((timestamp.getTimeInMillis() - lastTimeStamp.getTimeInMillis()) < ONE_DAY_IN_MILLIS) {
    return count++;
  }
 else {
    lastTimeStamp.set(Calendar.DAY_OF_MONTH,timestamp.get(Calendar.DAY_OF_MONTH));
    lastTimeStamp.set(Calendar.MONTH,timestamp.get(Calendar.MONTH));
    lastTimeStamp.set(Calendar.YEAR,timestamp.get(Calendar.YEAR));
    count=1;
    return 0;
  }
}

Fixed version (ground truth):
private synchronized int getCount(Calendar timestamp){
  if ((timestamp.get(Calendar.YEAR) == lastTimeStamp.get(Calendar.YEAR)) && (timestamp.get(Calendar.DAY_OF_YEAR) == lastTimeStamp.get(Calendar.DAY_OF_YEAR))) {
    return count++;
  }
 else {
    lastTimeStamp.set(Calendar.DAY_OF_YEAR,timestamp.get(Calendar.DAY_OF_YEAR));
    lastTimeStamp.set(Calendar.YEAR,timestamp.get(Calendar.YEAR));
    count=1;
    return 0;
  }
}
Program: 33322
Project: 33322
Buggy source:
public AbstractNIFDataset(String name){
  texts=new LinkedList<String>();
  annotationsList=new LinkedList<HashSet<Annotation>>();
  this.name=name;
}

Fixed version (ground truth):
public AbstractNIFDataset(WikipediaApiInterface wikiApi,DBPediaApi dbpediaApi,String name){
  texts=new LinkedList<String>();
  annotationsList=new LinkedList<HashSet<Annotation>>();
  this.name=name;
  this.wikiApi=wikiApi;
  this.dbpediaApi=dbpediaApi;
}
Program: 33323
Project: 33323
Buggy source:
public FileBasedNIFDataset(String filePath,String name,Lang language){
  super(name);
  this.filePath=filePath;
  this.language=language;
  init();
}

Fixed version (ground truth):
public FileBasedNIFDataset(WikipediaApiInterface wikiApi,DBPediaApi dbpediaApi,String filePath,String name,Lang language){
  super(wikiApi,dbpediaApi,name);
  this.filePath=filePath;
  this.language=language;
  init();
}
Program: 33324
Project: 33324
Buggy source:
public KnownNIFFileDatasetConfig(NIFDatasets dataset){
  super(dataset.getDatasetName(),true,ExperimentType.Sa2W);
  this.dataset=dataset;
}

Fixed version (ground truth):
public KnownNIFFileDatasetConfig(WikipediaApiInterface wikiApi,DBPediaApi dbpediaApi,NIFDatasets dataset){
  super(dataset.getDatasetName(),true,ExperimentType.Sa2W);
  this.dataset=dataset;
  this.wikiApi=wikiApi;
  this.dbpediaApi=dbpediaApi;
}
Program: 33325
Project: 33325
Buggy source:
@Override protected TopicDataset loadDataset() throws Exception {
  String propertyKey=NIF_DATASET_FILE_PROPERTY_NAME + dataset.name();
  String nifFile=GerbilConfiguration.getInstance().getString(propertyKey);
  if (nifFile == null) {
    throw new IOException("String_Node_Str" + propertyKey + "String_Node_Str");
  }
  return new FileBasedNIFDataset(nifFile,getDatasetName(),Lang.TTL);
}

Fixed version (ground truth):
@Override protected TopicDataset loadDataset() throws Exception {
  String propertyKey=NIF_DATASET_FILE_PROPERTY_NAME + dataset.name();
  String nifFile=GerbilConfiguration.getInstance().getString(propertyKey);
  if (nifFile == null) {
    throw new IOException("String_Node_Str" + propertyKey + "String_Node_Str");
  }
  return new FileBasedNIFDataset(wikiApi,dbpediaApi,nifFile,getDatasetName(),Lang.TTL);
}
Program: 33326
Project: 33326
Buggy source:
public static DatasetConfiguration getDatasetConfig(String name){
switch (name) {
case ACE2004DatasetConfig.DATASET_NAME:
    return new ACE2004DatasetConfig(SingletonWikipediaApi.getInstance());
case AQUAINTDatasetConfiguration.DATASET_NAME:
  return new AQUAINTDatasetConfiguration(SingletonWikipediaApi.getInstance());
case IITBDatasetConfig.DATASET_NAME:
return new IITBDatasetConfig(SingletonWikipediaApi.getInstance());
case CMNSDatasetConfig.DATASET_NAME:
return new CMNSDatasetConfig();
case MSNBCDatasetConfig.DATASET_NAME:
return new MSNBCDatasetConfig(SingletonWikipediaApi.getInstance());
}
if (name.startsWith(AIDACoNLLDatasetConfig.DATASET_NAME_START)) {
AIDACoNLLChunk chunk=null;
switch (name) {
case AIDACoNLLDatasetConfig.DATASET_NAME_START + "String_Node_Str":
{
chunk=AIDACoNLLChunk.TRAINING;
break;
}
case AIDACoNLLDatasetConfig.DATASET_NAME_START + "String_Node_Str":
{
chunk=AIDACoNLLChunk.TEST_A;
break;
}
case AIDACoNLLDatasetConfig.DATASET_NAME_START + "String_Node_Str":
{
chunk=AIDACoNLLChunk.TEST_B;
break;
}
case AIDACoNLLDatasetConfig.DATASET_NAME_START + "String_Node_Str":
{
chunk=AIDACoNLLChunk.COMPLETE;
break;
}
default :
return null;
}
return new AIDACoNLLDatasetConfig(chunk,SingletonWikipediaApi.getInstance());
}
NIFDatasets nifDatasets[]=NIFDatasets.values();
for (int i=0; i < nifDatasets.length; ++i) {
if (nifDatasets[i].getDatasetName().equals(name)) {
return new KnownNIFFileDatasetConfig(nifDatasets[i]);
}
}
return null;
}

Fixed version (ground truth):
public static DatasetConfiguration getDatasetConfig(String name){
switch (name) {
case ACE2004DatasetConfig.DATASET_NAME:
    return new ACE2004DatasetConfig(SingletonWikipediaApi.getInstance());
case AQUAINTDatasetConfiguration.DATASET_NAME:
  return new AQUAINTDatasetConfiguration(SingletonWikipediaApi.getInstance());
case IITBDatasetConfig.DATASET_NAME:
return new IITBDatasetConfig(SingletonWikipediaApi.getInstance());
case CMNSDatasetConfig.DATASET_NAME:
return new CMNSDatasetConfig();
case MSNBCDatasetConfig.DATASET_NAME:
return new MSNBCDatasetConfig(SingletonWikipediaApi.getInstance());
}
if (name.startsWith(AIDACoNLLDatasetConfig.DATASET_NAME_START)) {
AIDACoNLLChunk chunk=null;
switch (name) {
case AIDACoNLLDatasetConfig.DATASET_NAME_START + "String_Node_Str":
{
chunk=AIDACoNLLChunk.TRAINING;
break;
}
case AIDACoNLLDatasetConfig.DATASET_NAME_START + "String_Node_Str":
{
chunk=AIDACoNLLChunk.TEST_A;
break;
}
case AIDACoNLLDatasetConfig.DATASET_NAME_START + "String_Node_Str":
{
chunk=AIDACoNLLChunk.TEST_B;
break;
}
case AIDACoNLLDatasetConfig.DATASET_NAME_START + "String_Node_Str":
{
chunk=AIDACoNLLChunk.COMPLETE;
break;
}
default :
return null;
}
return new AIDACoNLLDatasetConfig(chunk,SingletonWikipediaApi.getInstance());
}
NIFDatasets nifDatasets[]=NIFDatasets.values();
for (int i=0; i < nifDatasets.length; ++i) {
if (nifDatasets[i].getDatasetName().equals(name)) {
return new KnownNIFFileDatasetConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi(),nifDatasets[i]);
}
}
return null;
}
Program: 33327
Project: 33327
Buggy source:
public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException {
  WikipediaApiInterface wikiAPI=SingletonWikipediaApi.getInstance();
  ExperimentTaskConfiguration taskConfigs[]=new ExperimentTaskConfiguration[]{new ExperimentTaskConfiguration(new AgdistisAnnotatorConfig(SingletonWikipediaApi.getInstance()),new KnownNIFFileDatasetConfig(NIFDatasets.KORE50),ExperimentType.D2W,Matching.STRONG_ANNOTATION_MATCH)};
  Experimenter experimenter=new Experimenter(wikiAPI,new SimpleLoggingDAO4Debugging(),taskConfigs,"String_Node_Str");
  experimenter.run();
}

Fixed version (ground truth):
public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException {
  WikipediaApiInterface wikiAPI=SingletonWikipediaApi.getInstance();
  ExperimentTaskConfiguration taskConfigs[]=new ExperimentTaskConfiguration[]{new ExperimentTaskConfiguration(new AgdistisAnnotatorConfig(SingletonWikipediaApi.getInstance()),new KnownNIFFileDatasetConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi(),NIFDatasets.KORE50),ExperimentType.D2W,Matching.STRONG_ANNOTATION_MATCH)};
  Experimenter experimenter=new Experimenter(wikiAPI,new SimpleLoggingDAO4Debugging(),taskConfigs,"String_Node_Str");
  experimenter.run();
}
Program: 33328
Project: 33328
Buggy source:
public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException {
  WikipediaApiInterface wikiAPI=SingletonWikipediaApi.getInstance();
  ExperimentTaskConfiguration taskConfigs[]=new ExperimentTaskConfiguration[]{new ExperimentTaskConfiguration(new BabelfyAnnotatorConfig(),new KnownNIFFileDatasetConfig(NIFDatasets.KORE50),ExperimentType.D2W,Matching.STRONG_ANNOTATION_MATCH)};
  Experimenter experimenter=new Experimenter(wikiAPI,new SimpleLoggingDAO4Debugging(),taskConfigs,"String_Node_Str");
  experimenter.run();
}

Fixed version (ground truth):
public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException {
  WikipediaApiInterface wikiAPI=SingletonWikipediaApi.getInstance();
  ExperimentTaskConfiguration taskConfigs[]=new ExperimentTaskConfiguration[]{new ExperimentTaskConfiguration(new BabelfyAnnotatorConfig(),new KnownNIFFileDatasetConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi(),NIFDatasets.KORE50),ExperimentType.D2W,Matching.STRONG_ANNOTATION_MATCH)};
  Experimenter experimenter=new Experimenter(wikiAPI,new SimpleLoggingDAO4Debugging(),taskConfigs,"String_Node_Str");
  experimenter.run();
}
Program: 33329
Project: 33329
Buggy source:
public static void runCompleteExperiment(){
  WikipediaApiInterface wikiAPI=SingletonWikipediaApi.getInstance();
  DBPediaApi dbpApi=new DBPediaApi();
  ExperimentTaskConfiguration taskConfigs[]=new ExperimentTaskConfiguration[]{new ExperimentTaskConfiguration(new NIFWebserviceAnnotatorConfiguration(ANNOTATOR_URL,ANNOTATOR_NAME,false,wikiAPI,dbpApi,ExperimentType.A2W),new KnownNIFFileDatasetConfig(NIFDatasets.KORE50),ExperimentType.A2W,Matching.WEAK_ANNOTATION_MATCH),new ExperimentTaskConfiguration(new SpotlightAnnotatorConfig(wikiAPI,dbpApi),new KnownNIFFileDatasetConfig(NIFDatasets.KORE50),ExperimentType.A2W,Matching.WEAK_ANNOTATION_MATCH)};
  Experimenter experimenter=new Experimenter(wikiAPI,new SimpleLoggingDAO4Debugging(),taskConfigs,"String_Node_Str");
  experimenter.run();
}

Fixed version (ground truth):
public static void runCompleteExperiment(){
  WikipediaApiInterface wikiAPI=SingletonWikipediaApi.getInstance();
  DBPediaApi dbpApi=new DBPediaApi();
  ExperimentTaskConfiguration taskConfigs[]=new ExperimentTaskConfiguration[]{new ExperimentTaskConfiguration(new NIFWebserviceAnnotatorConfiguration(ANNOTATOR_URL,ANNOTATOR_NAME,false,wikiAPI,dbpApi,ExperimentType.A2W),new KnownNIFFileDatasetConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi(),NIFDatasets.KORE50),ExperimentType.A2W,Matching.WEAK_ANNOTATION_MATCH),new ExperimentTaskConfiguration(new SpotlightAnnotatorConfig(wikiAPI,dbpApi),new KnownNIFFileDatasetConfig(SingletonWikipediaApi.getInstance(),new DBPediaApi(),NIFDatasets.KORE50),ExperimentType.A2W,Matching.WEAK_ANNOTATION_MATCH)};
  Experimenter experimenter=new Experimenter(wikiAPI,new SimpleLoggingDAO4Debugging(),taskConfigs,"String_Node_Str");
  experimenter.run();
}