Program: 161868
Project: 161868
Buggy source:
public void fmeasure(){
  double tp=0, fp=0, fn=0, tn=0;
  int documentId=0;
  for (  Document document : corpus) {
    try {
      System.gc();
      log.info("String_Node_Str" + documentId);
      if (0 < document.getProperty(DocumentText.class).getText().length()) {
        algo.run(document);
        NamedEntitiesInText namedEntities=document.getProperty(NamedEntitiesInText.class);
        for (        NamedEntityInText namedEntity : namedEntities) {
          if (namedEntity.getLength() > 2) {
            String correctVotingURL=namedEntity.getNamedEntityUri();
            if (correctVotingURL.startsWith("String_Node_Str"))             correctVotingURL=correctVotingURL.replace("String_Node_Str","String_Node_Str");
            if (correctVotingURL.startsWith("String_Node_Str"))             correctVotingURL=correctVotingURL.replace("String_Node_Str","String_Node_Str");
            if (correctVotingURL.startsWith("String_Node_Str")) {
              correctVotingURL="String_Node_Str";
            }
            correctVotingURL=algo.getRedirect(correctVotingURL);
            String disambiguatedURL=algo.getRedirect(algo.findResult(namedEntity));
            log.info("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            if (correctVotingURL.equals(disambiguatedURL)) {
              tp++;
              log.info("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else             if (correctVotingURL.startsWith("String_Node_Str") && disambiguatedURL == null) {
              fn++;
              log.info("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else             if ((correctVotingURL.startsWith("String_Node_Str") || correctVotingURL.startsWith("String_Node_Str")) && disambiguatedURL == null) {
              tn++;
              log.info("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else             if (correctVotingURL.startsWith("String_Node_Str") && disambiguatedURL.startsWith("String_Node_Str") && !(correctVotingURL.equals(disambiguatedURL))) {
              fp++;
              log.info("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else             if ((correctVotingURL.startsWith("String_Node_Str") || correctVotingURL.startsWith("String_Node_Str")) && disambiguatedURL.startsWith("String_Node_Str")) {
              fp++;
              log.info("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else {
              log.error("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
          }
        }
      }
 else {
        log.error("String_Node_Str");
      }
      documentId++;
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + documentId);
      log.error(e.getLocalizedMessage());
    }
  }
  double precision=tp / (tp + fp);
  double recall=tp / (tp + fn);
  fmeasure=2 * ((precision * recall) / (precision + recall));
  log.error("String_Node_Str" + fmeasure + "String_Node_Str"+ threshholdTrigram);
}

Fixed version (ground truth):
public void fmeasure(){
  double tp=0, fp=0, fn=0, tn=0;
  int documentId=0;
  for (  Document document : corpus) {
    try {
      System.gc();
      log.debug("String_Node_Str" + documentId);
      if (0 < document.getProperty(DocumentText.class).getText().length()) {
        algo.run(document);
        NamedEntitiesInText namedEntities=document.getProperty(NamedEntitiesInText.class);
        for (        NamedEntityInText namedEntity : namedEntities) {
          if (namedEntity.getLength() > 2) {
            String correctVotingURL=namedEntity.getNamedEntityUri();
            if (correctVotingURL.startsWith("String_Node_Str"))             correctVotingURL=correctVotingURL.replace("String_Node_Str","String_Node_Str");
            if (correctVotingURL.startsWith("String_Node_Str"))             correctVotingURL=correctVotingURL.replace("String_Node_Str","String_Node_Str");
            if (correctVotingURL.startsWith("String_Node_Str")) {
              correctVotingURL="String_Node_Str";
            }
            correctVotingURL=algo.getRedirect(correctVotingURL);
            String disambiguatedURL=algo.getRedirect(algo.findResult(namedEntity));
            if (correctVotingURL.equals(disambiguatedURL)) {
              tp++;
              log.debug("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else             if (correctVotingURL.startsWith("String_Node_Str") && disambiguatedURL == null) {
              fn++;
              log.debug("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else             if ((correctVotingURL.startsWith("String_Node_Str") || correctVotingURL.startsWith("String_Node_Str")) && disambiguatedURL == null) {
              tn++;
              log.debug("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else             if (correctVotingURL.startsWith("String_Node_Str") && disambiguatedURL.startsWith("String_Node_Str") && !(correctVotingURL.equals(disambiguatedURL))) {
              fp++;
              log.debug("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else             if ((correctVotingURL.startsWith("String_Node_Str") || correctVotingURL.startsWith("String_Node_Str")) && disambiguatedURL.startsWith("String_Node_Str")) {
              fp++;
              log.debug("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
 else {
              log.error("String_Node_Str" + correctVotingURL + "String_Node_Str"+ disambiguatedURL);
            }
          }
        }
      }
 else {
        log.error("String_Node_Str");
      }
      documentId++;
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + documentId);
      log.error(e.getLocalizedMessage());
    }
  }
  double precision=tp / (tp + fp);
  double recall=tp / (tp + fn);
  fmeasure=2 * ((precision * recall) / (precision + recall));
  log.error("String_Node_Str" + fmeasure + "String_Node_Str"+ threshholdTrigram);
}