Program: 33235
Project: 33235
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str","String_Node_Str"}) protected Evaluator createEvaluator(ExperimentType type,ExperimentTaskConfiguration configuration,Dataset dataset,SameAsRetriever globalRetriever,UriKBClassifier globalClassifier,SubClassInferencer inferencer){
switch (type) {
case C2KB:
{
      SameAsRetriever localRetriever=getSameAsRetriever(dataset);
      return new ConfidenceScoreEvaluatorDecorator<Meaning>(new InKBClassBasedFMeasureCalculator<Meaning>(new MeaningMatchingsSearcher<Meaning>(globalClassifier,globalRetriever,localRetriever,null),globalClassifier),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
    }
case Sa2KB:
case A2KB:
case EExt:
{
    SameAsRetriever localRetriever=getSameAsRetriever(dataset);
    return new ConfidenceScoreEvaluatorDecorator<NamedEntity>(new FMeasureCalculator<NamedEntity>(new MatchingsCounterImpl<NamedEntity>(new CompoundMatchingsCounter<NamedEntity>((MatchingsSearcher<NamedEntity>)MatchingFactory.createSpanMatchingsSearcher(configuration.matching),new MeaningMatchingsSearcher<NamedEntity>(globalClassifier,globalRetriever,localRetriever,null)))),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
  }
case ERec:
{
  return new ConfidenceScoreEvaluatorDecorator<Span>(new FMeasureCalculator<Span>(new MatchingsCounterImpl<Span>((MatchingsSearcher<Span>)MatchingFactory.createSpanMatchingsSearcher(configuration.matching))),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case D2KB:
case ELink:
{
SameAsRetriever localRetriever=getSameAsRetriever(dataset);
return new ConfidenceScoreEvaluatorDecorator<NamedEntity>(new InKBClassBasedFMeasureCalculator<NamedEntity>(new CompoundMatchingsCounter<NamedEntity>((MatchingsSearcher<NamedEntity>)MatchingFactory.createSpanMatchingsSearcher(configuration.matching),new MeaningMatchingsSearcher<NamedEntity>(globalClassifier,globalRetriever,localRetriever,null)),globalClassifier),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
}
case ETyping:
{
return new ConfidenceScoreEvaluatorDecorator<TypedSpan>(new HierarchicalFMeasureCalculator<TypedSpan>(new HierarchicalMatchingsCounter<TypedSpan>((MatchingsSearcher<TypedSpan>)MatchingFactory.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.ELink,Matching.STRONG_ENTITY_MATCH);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ELink,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,globalRetriever,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,globalRetriever,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,SameAsRetriever globalRetriever,UriKBClassifier globalClassifier,SubClassInferencer inferencer){
switch (type) {
case C2KB:
{
      SameAsRetriever localRetriever=getSameAsRetriever(dataset);
      return new ConfidenceScoreEvaluatorDecorator<Meaning>(new InKBClassBasedFMeasureCalculator<Meaning>(new MeaningMatchingsSearcher<Meaning>(globalClassifier,globalRetriever,localRetriever,null),globalClassifier),FMeasureCalculator.MICRO_F1_SCORE_NAME,new DoubleResultComparator());
    }
case Sa2KB:
case A2KB:
case EExt:
{
    SameAsRetriever localRetriever=getSameAsRetriever(dataset);
    return new ConfidenceScoreEvaluatorDecorator<NamedEntity>(new FMeasureCalculator<NamedEntity>(new MatchingsCounterImpl<NamedEntity>(new CompoundMatchingsCounter<NamedEntity>((MatchingsSearcher<NamedEntity>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching),new MeaningMatchingsSearcher<NamedEntity>(globalClassifier,globalRetriever,localRetriever,null)))),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:
case ELink:
{
SameAsRetriever localRetriever=getSameAsRetriever(dataset);
return new ConfidenceScoreEvaluatorDecorator<NamedEntity>(new InKBClassBasedFMeasureCalculator<NamedEntity>(new CompoundMatchingsCounter<NamedEntity>((MatchingsSearcher<NamedEntity>)MatchingsSearcherFactory.createSpanMatchingsSearcher(configuration.matching),new MeaningMatchingsSearcher<NamedEntity>(globalClassifier,globalRetriever,localRetriever,null)),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.ELink,Matching.STRONG_ENTITY_MATCH);
evaluators.add(new SubTaskEvaluator<>(subTaskConfig,(Evaluator<TypedNamedEntity>)createEvaluator(ExperimentType.ELink,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,globalRetriever,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,globalRetriever,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");
}
}
}