Program: 33273
Project: 33273
Buggy source:
@SuppressWarnings("String_Node_Str") private EvaluationResult runExperiment(Dataset dataset,Annotator annotator,Evaluator<?> evaluator,ExperimentTaskState state) throws GerbilException {
  EvaluationResult evalResult=null;
switch (configuration.type) {
case D2KB:
case ELink:
{
      try {
        List<List<NamedEntity>> results=new ArrayList<List<NamedEntity>>(dataset.size());
        List<List<NamedEntity>> goldStandard=new ArrayList<List<NamedEntity>>(dataset.size());
        EntityLinker linker=((EntityLinker)annotator);
        for (        Document document : dataset.getInstances()) {
          results.add(linker.performLinking(document));
          goldStandard.add(document.getMarkings(NamedEntity.class));
        }
        evalResult=((Evaluator<NamedEntity>)evaluator).evaluate(results,goldStandard);
      }
 catch (      Exception e) {
        throw new GerbilException(e,ErrorTypes.UNEXPECTED_EXCEPTION);
      }
      break;
    }
case A2KB:
case Sa2KB:
case EExt:
{
    try {
      List<List<NamedEntity>> results=new ArrayList<List<NamedEntity>>(dataset.size());
      List<List<NamedEntity>> goldStandard=new ArrayList<List<NamedEntity>>(dataset.size());
      EntityLinker linker=((EntityLinker)annotator);
      for (      Document document : dataset.getInstances()) {
        results.add(linker.performLinking(document));
        goldStandard.add(document.getMarkings(NamedEntity.class));
      }
      evalResult=((Evaluator<NamedEntity>)evaluator).evaluate(results,goldStandard);
    }
 catch (    Exception e) {
      throw new GerbilException(e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
    break;
  }
case C2KB:
{
  throw new GerbilException(ErrorTypes.UNEXPECTED_EXCEPTION);
}
case Sc2KB:
case Rc2KB:
{
throw new GerbilException(ErrorTypes.UNEXPECTED_EXCEPTION);
}
case ERec:
{
try {
List<List<Span>> results=new ArrayList<List<Span>>(dataset.size());
List<List<Span>> goldStandard=new ArrayList<List<Span>>(dataset.size());
EntityRecognizer recognizer=((EntityRecognizer)annotator);
for (Document document : dataset.getInstances()) {
  results.add(recognizer.performRecognition(document));
  goldStandard.add(document.getMarkings(Span.class));
}
evalResult=((Evaluator<Span>)evaluator).evaluate(results,goldStandard);
}
 catch (Exception e) {
throw new GerbilException(e,ErrorTypes.UNEXPECTED_EXCEPTION);
}
break;
}
default :
throw new GerbilException("String_Node_Str",ErrorTypes.UNEXPECTED_EXCEPTION);
}
return evalResult;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) private EvaluationResult runExperiment(Dataset dataset,Annotator annotator,List<Evaluator<? extends Marking>> evaluators,ExperimentTaskState state) throws GerbilException {
  EvaluationResult evalResult=null;
switch (configuration.type) {
case D2KB:
case ELink:
{
      try {
        List<List<NamedEntity>> results=new ArrayList<List<NamedEntity>>(dataset.size());
        List<List<NamedEntity>> goldStandard=new ArrayList<List<NamedEntity>>(dataset.size());
        EntityLinker linker=((EntityLinker)annotator);
        for (        Document document : dataset.getInstances()) {
          results.add(linker.performLinking(DocumentInformationReducer.reduceToTextAndSpans(document)));
          goldStandard.add(document.getMarkings(NamedEntity.class));
          taskState.increaseExperimentStepCount();
        }
        evalResult=evaluate(evaluators,results,goldStandard);
      }
 catch (      Exception e) {
        throw new GerbilException(e,ErrorTypes.UNEXPECTED_EXCEPTION);
      }
      break;
    }
case A2KB:
case Sa2KB:
case EExt:
{
    try {
      List<List<NamedEntity>> results=new ArrayList<List<NamedEntity>>(dataset.size());
      List<List<NamedEntity>> goldStandard=new ArrayList<List<NamedEntity>>(dataset.size());
      EntityLinker linker=((EntityLinker)annotator);
      for (      Document document : dataset.getInstances()) {
        results.add(linker.performLinking(DocumentInformationReducer.reduceToPlainText(document)));
        goldStandard.add(document.getMarkings(NamedEntity.class));
        taskState.increaseExperimentStepCount();
      }
      evalResult=evaluate(evaluators,results,goldStandard);
    }
 catch (    Exception e) {
      throw new GerbilException(e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
    break;
  }
case C2KB:
{
  throw new GerbilException(ErrorTypes.UNEXPECTED_EXCEPTION);
}
case Sc2KB:
case Rc2KB:
{
throw new GerbilException(ErrorTypes.UNEXPECTED_EXCEPTION);
}
case ERec:
{
try {
List<List<Span>> results=new ArrayList<List<Span>>(dataset.size());
List<List<Span>> goldStandard=new ArrayList<List<Span>>(dataset.size());
EntityRecognizer recognizer=((EntityRecognizer)annotator);
for (Document document : dataset.getInstances()) {
  results.add(recognizer.performRecognition(DocumentInformationReducer.reduceToPlainText(document)));
  goldStandard.add(document.getMarkings(Span.class));
  taskState.increaseExperimentStepCount();
}
evalResult=evaluate(evaluators,results,goldStandard);
}
 catch (Exception e) {
throw new GerbilException(e,ErrorTypes.UNEXPECTED_EXCEPTION);
}
break;
}
default :
throw new GerbilException("String_Node_Str",ErrorTypes.UNEXPECTED_EXCEPTION);
}
return evalResult;
}