Program: 161857
Project: 161857
Buggy source:
private void checkLabelCandidates(DirectedSparseGraph<Node,String> graph,double threshholdTrigram,HashMap<String,Node> nodes,NamedEntityInText entity,String label,boolean searchInSurfaceForms){
  label=corporationAffixCleaner.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) {
    log.debug("String_Node_Str" + c);
    String candidateURL=c.getSubject();
    String surfaceForm=c.getObject();
    if (candidateURL.startsWith(nodeType) && !candidateURL.matches("String_Node_Str")) {
      if (nGramDistance.getDistance(surfaceForm,label) < threshholdTrigram) {
        continue;
      }
      if (isDisambiguationResource(candidateURL)) {
        continue;
      }
      candidateURL=redirect(candidateURL);
      if (domainWhiteLister.fitsIntoDomain(candidateURL)) {
        addNodeToGraph(graph,nodes,entity,c,candidateURL);
        added=true;
      }
    }
  }
  if (!added && !searchInSurfaceForms)   checkLabelCandidates(graph,threshholdTrigram,nodes,entity,label,true);
}

Fixed version (ground truth):
private void checkLabelCandidates(DirectedSparseGraph<Node,String> graph,double threshholdTrigram,HashMap<String,Node> nodes,NamedEntityInText entity,String label,boolean searchInSurfaceForms){
  label=corporationAffixCleaner.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) {
    log.debug("String_Node_Str" + c);
    String candidateURL=c.getSubject();
    String surfaceForm=c.getObject();
    if (candidateURL.startsWith(nodeType) && !candidateURL.matches("String_Node_Str")) {
      if (nGramDistance.getDistance(surfaceForm.toLowerCase(),label.toLowerCase()) < threshholdTrigram) {
        continue;
      }
      if (isDisambiguationResource(candidateURL)) {
        continue;
      }
      candidateURL=redirect(candidateURL);
      if (domainWhiteLister.fitsIntoDomain(candidateURL)) {
        addNodeToGraph(graph,nodes,entity,c,candidateURL);
        added=true;
      }
    }
  }
  if (!added && !searchInSurfaceForms)   checkLabelCandidates(graph,threshholdTrigram,nodes,entity,label,true);
}