Program: 33229
Project: 33229
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str","String_Node_Str"}) protected Evaluator createEvaluator(ExperimentType type,ExperimentTaskConfiguration configuration,Dataset dataset,UriKBClassifier globalClassifier,SubClassInferencer inferencer){
switch (type) {
case C2KB:
{
      return new ConfidenceScoreEvaluatorDecorator<Meaning>(new InKBClassBasedFMeasureCalculator<Meaning>(new MeaningMatchingsSearcher<Meaning>(globalClassifier),globalClassifier),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
    }
case Sa2KB:
case A2KB:
{
    return new ConfidenceScoreEvaluatorDecorator<NamedEntity>(new FMeasureCalculator<NamedEntity>(new MatchingsCounterImpl<NamedEntity>(new CompoundMatchingsCounter<NamedEntity>((MatchingsSearcher<NamedEntity>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching),new MeaningMatchingsSearcher<NamedEntity>(globalClassifier)))),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
  }
case ERec:
{
  return new ConfidenceScoreEvaluatorDecorator<Span>(new FMeasureCalculator<Span>(new MatchingsCounterImpl<Span>((MatchingsSearcher<Span>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching))),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case D2KB:
{
return new ConfidenceScoreEvaluatorDecorator<NamedEntity>(new InKBClassBasedFMeasureCalculator<NamedEntity>(new CompoundMatchingsCounter<NamedEntity>((MatchingsSearcher<NamedEntity>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching),new MeaningMatchingsSearcher<NamedEntity>(globalClassifier)),globalClassifier),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case ETyping:
{
return new ConfidenceScoreEvaluatorDecorator<TypedSpan>(new HierarchicalFMeasureCalculator<TypedSpan>(new HierarchicalMatchingsCounter<TypedSpan>((MatchingsSearcher<TypedSpan>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching),globalClassifier,inferencer)),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case OKE_Task1:
{
ExperimentTaskConfiguration subTaskConfig;
List<SubTaskEvaluator<TypedNamedEntity>> evaluators=new ArrayList<SubTaskEvaluator<TypedNamedEntity>>();
UriKBClassifier okeClassifierTask1=new ExactWhiteListBasedUriKBClassifier(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.ERec,configuration.matching);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ERec,subTaskConfig,dataset)));
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.D2KB,Matching.STRONG_ENTITY_MATCH);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.D2KB,subTaskConfig,dataset)));
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.ETyping,Matching.STRONG_ENTITY_MATCH);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ETyping,subTaskConfig,dataset,okeClassifierTask1,inferencer)));
return new ConfidenceScoreEvaluatorDecorator<TypedNamedEntity>(new SubTaskAverageCalculator<TypedNamedEntity>(evaluators),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case OKE_Task2:
{
ExperimentTaskConfiguration subTaskConfig;
List<SubTaskEvaluator<TypedNamedEntity>> evaluators=new ArrayList<SubTaskEvaluator<TypedNamedEntity>>();
String classTypes[]=new String[]{RDFS.Class.getURI(),OWL.Class.getURI()};
UriKBClassifier okeClassifierTask2=new SimpleWhiteListBasedUriKBClassifier("String_Node_Str");
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.ETyping,Matching.STRONG_ENTITY_MATCH);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,new MarkingFilteringEvaluatorDecorator<>(new TypeBasedMarkingFilter<TypedNamedEntity>(false,classTypes),(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ETyping,subTaskConfig,dataset,okeClassifierTask2,inferencer))));
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.ERec,configuration.matching);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,new MarkingFilteringEvaluatorDecorator<>(new TypeBasedMarkingFilter<TypedNamedEntity>(true,classTypes),new SpanMergingEvaluatorDecorator<>((Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ERec,subTaskConfig,dataset)))));
return new ConfidenceScoreEvaluatorDecorator<TypedNamedEntity>(new SubTaskAverageCalculator<TypedNamedEntity>(evaluators),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
default :
{
throw new IllegalArgumentException("String_Node_Str");
}
}
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str","String_Node_Str"}) protected Evaluator createEvaluator(ExperimentType type,ExperimentTaskConfiguration configuration,Dataset dataset,UriKBClassifier globalClassifier,SubClassInferencer inferencer){
switch (type) {
case C2KB:
{
      return new ConfidenceScoreEvaluatorDecorator<Meaning>(new InKBClassBasedFMeasureCalculator<Meaning>(new MeaningMatchingsSearcher<Meaning>(globalClassifier),globalClassifier),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
    }
case Sa2KB:
case A2KB:
{
    return new ConfidenceScoreEvaluatorDecorator<NamedEntity>(new InKBClassBasedFMeasureCalculator<NamedEntity>(new CompoundMatchingsCounter<NamedEntity>((MatchingsSearcher<NamedEntity>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching),new MeaningMatchingsSearcher<NamedEntity>(globalClassifier)),globalClassifier),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
  }
case ERec:
{
  return new ConfidenceScoreEvaluatorDecorator<Span>(new FMeasureCalculator<Span>(new MatchingsCounterImpl<Span>((MatchingsSearcher<Span>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching))),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case D2KB:
{
return new ConfidenceScoreEvaluatorDecorator<NamedEntity>(new InKBClassBasedFMeasureCalculator<NamedEntity>(new CompoundMatchingsCounter<NamedEntity>((MatchingsSearcher<NamedEntity>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching),new MeaningMatchingsSearcher<NamedEntity>(globalClassifier)),globalClassifier),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case ETyping:
{
return new ConfidenceScoreEvaluatorDecorator<TypedSpan>(new HierarchicalFMeasureCalculator<TypedSpan>(new HierarchicalMatchingsCounter<TypedSpan>((MatchingsSearcher<TypedSpan>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching),globalClassifier,inferencer)),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case OKE_Task1:
{
ExperimentTaskConfiguration subTaskConfig;
List<SubTaskEvaluator<TypedNamedEntity>> evaluators=new ArrayList<SubTaskEvaluator<TypedNamedEntity>>();
UriKBClassifier okeClassifierTask1=new ExactWhiteListBasedUriKBClassifier(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.ERec,configuration.matching);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ERec,subTaskConfig,dataset)));
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.D2KB,Matching.STRONG_ENTITY_MATCH);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.D2KB,subTaskConfig,dataset)));
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.ETyping,Matching.STRONG_ENTITY_MATCH);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ETyping,subTaskConfig,dataset,okeClassifierTask1,inferencer)));
return new ConfidenceScoreEvaluatorDecorator<TypedNamedEntity>(new SubTaskAverageCalculator<TypedNamedEntity>(evaluators),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case OKE_Task2:
{
ExperimentTaskConfiguration subTaskConfig;
List<SubTaskEvaluator<TypedNamedEntity>> evaluators=new ArrayList<SubTaskEvaluator<TypedNamedEntity>>();
String classTypes[]=new String[]{RDFS.Class.getURI(),OWL.Class.getURI()};
UriKBClassifier okeClassifierTask2=new SimpleWhiteListBasedUriKBClassifier("String_Node_Str");
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.ETyping,Matching.STRONG_ENTITY_MATCH);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,new MarkingFilteringEvaluatorDecorator<>(new TypeBasedMarkingFilter<TypedNamedEntity>(false,classTypes),(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ETyping,subTaskConfig,dataset,okeClassifierTask2,inferencer))));
subTaskConfig=new ExperimentTaskConfiguration(configuration.annotatorConfig,configuration.datasetConfig,ExperimentType.ERec,configuration.matching);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,new MarkingFilteringEvaluatorDecorator<>(new TypeBasedMarkingFilter<TypedNamedEntity>(true,classTypes),new SpanMergingEvaluatorDecorator<>((Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ERec,subTaskConfig,dataset)))));
return new ConfidenceScoreEvaluatorDecorator<TypedNamedEntity>(new SubTaskAverageCalculator<TypedNamedEntity>(evaluators),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
default :
{
throw new IllegalArgumentException("String_Node_Str");
}
}
}