Program: 161867
Project: 161867
Buggy source:
private void checkLabelCandidates(DirectedSparseGraph<Node,String> graph,double threshholdTrigram,HashMap<String,Node> nodes,NamedEntityInText entity,String label,String knowledgeBase,boolean searchInSurfaceForms){
  label=cleanLabelsfromCorporationIdentifier(label);
  label=label.trim();
  List<Triple> candidates=new ArrayList<Triple>();
  candidates=searchCandidatesByLabel(label,searchInSurfaceForms);
  log.info("String_Node_Str" + candidates.size());
  if (candidates.size() == 0) {
    log.info("String_Node_Str" + label);
    if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=searchCandidatesByLabel(label,searchInSurfaceForms);
      log.info("String_Node_Str");
    }
 else     if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=searchCandidatesByLabel(label,searchInSurfaceForms);
      log.info("String_Node_Str");
    }
  }
  boolean added=false;
  for (  Triple c : candidates) {
    String candidateURL=c.getSubject();
    String surfaceForm=c.getObject();
    if (candidateURL.startsWith(nodeType) && !candidateURL.matches("String_Node_Str")) {
      if (trigramForURLLabel(surfaceForm,label) < threshholdTrigram) {
        continue;
      }
      if (isDisambiguationResource(candidateURL)) {
        continue;
      }
      if (!nodeType.equals("String_Node_Str")) {
        candidateURL=redirect(candidateURL);
      }
      if (fitsIntoDomain(candidateURL,knowledgeBase)) {
        addNodeToGraph(graph,nodes,entity,c,candidateURL);
        added=true;
      }
    }
  }
  if (!added)   checkLabelCandidates(graph,threshholdTrigram,nodes,entity,label,nodeType,true);
}

Fixed version (ground truth):
private void checkLabelCandidates(DirectedSparseGraph<Node,String> graph,double threshholdTrigram,HashMap<String,Node> nodes,NamedEntityInText entity,String label,String knowledgeBase,boolean searchInSurfaceForms){
  label=cleanLabelsfromCorporationIdentifier(label);
  label=label.trim();
  List<Triple> candidates=new ArrayList<Triple>();
  candidates=searchCandidatesByLabel(label,searchInSurfaceForms);
  log.info("String_Node_Str" + candidates.size());
  if (candidates.size() == 0) {
    log.info("String_Node_Str" + label);
    if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=searchCandidatesByLabel(label,searchInSurfaceForms);
      log.info("String_Node_Str");
    }
 else     if (label.endsWith("String_Node_Str")) {
      label=label.substring(0,label.lastIndexOf("String_Node_Str"));
      candidates=searchCandidatesByLabel(label,searchInSurfaceForms);
      log.info("String_Node_Str");
    }
  }
  boolean added=false;
  for (  Triple c : candidates) {
    String candidateURL=c.getSubject();
    String surfaceForm=c.getObject();
    if (candidateURL.startsWith(nodeType) && !candidateURL.matches("String_Node_Str")) {
      if (trigramForURLLabel(surfaceForm,label) < threshholdTrigram) {
        continue;
      }
      if (isDisambiguationResource(candidateURL)) {
        continue;
      }
      if (!nodeType.equals("String_Node_Str")) {
        candidateURL=redirect(candidateURL);
      }
      if (fitsIntoDomain(candidateURL,knowledgeBase)) {
        addNodeToGraph(graph,nodes,entity,c,candidateURL);
        added=true;
      }
    }
  }
  if (!added && !searchInSurfaceForms)   checkLabelCandidates(graph,threshholdTrigram,nodes,entity,label,nodeType,true);
}