Program: 24872
Project: 24872
Buggy source:
@Override public BootstrapInspector.ObservationSummarizer<EvalPair<DocLevelArgLinking,DocLevelArgLinking>,DocLevelLinkingScoring> createObservationSummarizer(){
  return new BootstrapInspector.ObservationSummarizer<EvalPair<DocLevelArgLinking,DocLevelArgLinking>,DocLevelLinkingScoring>(){
    @Override public DocLevelLinkingScoring summarizeObservation(    final EvalPair<DocLevelArgLinking,DocLevelArgLinking> item){
      final Symbol keyDocId=item.key().docID();
      final Symbol testDocId=item.test().docID();
      checkArgument(ImmutableSet.copyOf(concat(item.key())).containsAll(ImmutableSet.copyOf(concat(item.test()))),"String_Node_Str");
      if (!keyDocId.equalTo(testDocId)) {
        log.warn("String_Node_Str",keyDocId,testDocId);
      }
      final LinkingScoreDocRecord.Builder linkingScoreDocRecordB=new LinkingScoreDocRecord.Builder();
      final ImmutableMap.Builder<Symbol,LinkingScoreDocRecord> recordsPerEventB=ImmutableMap.builder();
      final ExplicitFMeasureInfo counts=LinkF1.create().score(item.test(),item.key());
      final File docOutput=new File(outputDir,keyDocId.asString());
      docOutput.mkdirs();
      final PrintWriter outputWriter;
      try {
        outputWriter=new PrintWriter(new File(docOutput,"String_Node_Str"));
        outputWriter.println(counts.toString());
        outputWriter.close();
      }
 catch (      FileNotFoundException e) {
        throw new TACKBPEALException(e);
      }
      final ImmutableSet<DocLevelEventArg> args=ImmutableSet.copyOf(concat(transform(concat(item.test().eventFrames(),item.key().eventFrames()),ScoringEventFrameFunctions.arguments())));
      linkingScoreDocRecordB.fMeasureInfo(counts).predictedCounts(ImmutableSet.copyOf(concat(item.test().eventFrames())).size()).actualCounts(ImmutableSet.copyOf(concat(item.key().eventFrames())).size()).linkingArgCounts(args.size());
      final ImmutableSet<Symbol> eventTypes=FluentIterable.from(item.test().eventFrames()).append(item.key().eventFrames()).transform(ScoringEventFrameFunctions.eventType()).toSet();
      for (      final Symbol eventType : eventTypes) {
        final Predicate<DocLevelEventArg> argPred=Predicates.compose(Predicates.equalTo(eventType),DocLevelEventArgFunctions.eventType());
        DocLevelArgLinking filteredKey=item.key().filterArguments(argPred);
        DocLevelArgLinking filteredTest=item.test().filterArguments(argPred);
        final ExplicitFMeasureInfo countsForEventType=LinkF1.create().score(filteredTest,filteredKey);
        final ImmutableSet<DocLevelEventArg> argsForEventType=ImmutableSet.copyOf(concat(transform(concat(filteredTest.eventFrames(),filteredKey.eventFrames()),ScoringEventFrameFunctions.arguments())));
        final LinkingScoreDocRecord recordForEventType=new LinkingScoreDocRecord.Builder().fMeasureInfo(countsForEventType).predictedCounts(ImmutableSet.copyOf(concat(filteredTest.eventFrames())).size()).actualCounts(ImmutableSet.copyOf(concat(filteredKey.eventFrames())).size()).linkingArgCounts(argsForEventType.size()).build();
        recordsPerEventB.put(eventType,recordForEventType);
      }
      return new DocLevelLinkingScoring.Builder().linkingScoreDocRecord(linkingScoreDocRecordB.build()).docRecordsPerEventType(recordsPerEventB.build()).build();
    }
  }
;
}

Fixed version (ground truth):
@Override public BootstrapInspector.ObservationSummarizer<EvalPair<DocLevelArgLinking,DocLevelArgLinking>,DocLevelLinkingScoring> createObservationSummarizer(){
  return new BootstrapInspector.ObservationSummarizer<EvalPair<DocLevelArgLinking,DocLevelArgLinking>,DocLevelLinkingScoring>(){
    @Override public DocLevelLinkingScoring summarizeObservation(    final EvalPair<DocLevelArgLinking,DocLevelArgLinking> item){
      final Symbol keyDocId=item.key().docID();
      final Symbol testDocId=item.test().docID();
      checkArgument(ImmutableSet.copyOf(concat(item.key())).containsAll(ImmutableSet.copyOf(concat(item.test()))),"String_Node_Str");
      if (!keyDocId.equalTo(testDocId)) {
        log.warn("String_Node_Str",keyDocId,testDocId);
      }
      final LinkingScoreDocRecord.Builder linkingScoreDocRecordB=new LinkingScoreDocRecord.Builder();
      final ImmutableMap.Builder<Symbol,LinkingScoreDocRecord> recordsPerEventB=ImmutableMap.builder();
      final ExplicitFMeasureInfo counts=LinkF1.create().score(item.test(),item.key());
      final File docOutput=new File(outputDir,keyDocId.asString());
      docOutput.mkdirs();
      final PrintWriter outputWriter;
      try {
        Files.asCharSink(new File(docOutput,"String_Node_Str"),Charsets.UTF_8).write(counts.toString());
      }
 catch (      IOException e) {
        throw new TACKBPEALException(e);
      }
      final ImmutableSet<DocLevelEventArg> args=ImmutableSet.copyOf(concat(transform(concat(item.test().eventFrames(),item.key().eventFrames()),ScoringEventFrameFunctions.arguments())));
      linkingScoreDocRecordB.fMeasureInfo(counts).predictedCounts(ImmutableSet.copyOf(concat(item.test().eventFrames())).size()).actualCounts(ImmutableSet.copyOf(concat(item.key().eventFrames())).size()).linkingArgCounts(args.size());
      final ImmutableSet<Symbol> eventTypes=FluentIterable.from(item.test().eventFrames()).append(item.key().eventFrames()).transform(ScoringEventFrameFunctions.eventType()).toSet();
      for (      final Symbol eventType : eventTypes) {
        final Predicate<DocLevelEventArg> argPred=Predicates.compose(Predicates.equalTo(eventType),DocLevelEventArgFunctions.eventType());
        DocLevelArgLinking filteredKey=item.key().filterArguments(argPred);
        DocLevelArgLinking filteredTest=item.test().filterArguments(argPred);
        final ExplicitFMeasureInfo countsForEventType=LinkF1.create().score(filteredTest,filteredKey);
        final ImmutableSet<DocLevelEventArg> argsForEventType=ImmutableSet.copyOf(concat(transform(concat(filteredTest.eventFrames(),filteredKey.eventFrames()),ScoringEventFrameFunctions.arguments())));
        final LinkingScoreDocRecord recordForEventType=new LinkingScoreDocRecord.Builder().fMeasureInfo(countsForEventType).predictedCounts(ImmutableSet.copyOf(concat(filteredTest.eventFrames())).size()).actualCounts(ImmutableSet.copyOf(concat(filteredKey.eventFrames())).size()).linkingArgCounts(argsForEventType.size()).build();
        recordsPerEventB.put(eventType,recordForEventType);
      }
      return new DocLevelLinkingScoring.Builder().linkingScoreDocRecord(linkingScoreDocRecordB.build()).docRecordsPerEventType(recordsPerEventB.build()).build();
    }
  }
;
}