Program: 28471
Project: 28471
Buggy source:
private boolean validateLookup(ActiveDescriptor<?> candidate,Injectee injectee){
  if (LOG.isLoggable(Level.FINE)) {
    LOG.fine("String_Node_Str" + candidate + "String_Node_Str"+ injectee);
  }
  if (!candidate.isReified()) {
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str");
    }
    return true;
  }
 else {
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str" + candidate);
    }
  }
  Set<String> contracts=candidate.getAdvertisedContracts();
  if (contracts == null)   return true;
  Map<String,List<String>> md=candidate.getMetadata();
  if (LOG.isLoggable(Level.FINE)) {
    for (    String s : md.keySet()) {
      for (      String v : md.get(s)) {
        LOG.fine("String_Node_Str" + s + "String_Node_Str"+ v);
      }
    }
  }
  Permission perm=null;
  List<String> names=md.get(Secure.NAME);
  if (names == null || names.isEmpty()) {
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str");
    }
    perm=getAccessPermision(Secure.DEFAULT_PERM_NAME,null);
  }
 else {
    String permName=names.get(0);
    perm=getAccessPermision(permName,null);
  }
  if (LOG.isLoggable(Level.FINE)) {
    LOG.fine("String_Node_Str" + perm);
  }
  boolean check_result=false;
  if (injectee == null) {
    Class caller=getServiceLookupCaller();
    check_result=checkPerm(perm,caller);
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str" + perm + "String_Node_Str"+ check_result);
    }
  }
 else {
    check_result=validateInjection(candidate,injectee,perm);
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str" + perm + "String_Node_Str"+ check_result);
    }
  }
  return check_result;
}

Fixed version (ground truth):
private boolean validateLookup(ActiveDescriptor<?> candidate,Injectee injectee){
  if (LOG.isLoggable(Level.FINE)) {
    LOG.fine("String_Node_Str" + candidate + "String_Node_Str"+ injectee);
  }
  if (!candidate.isReified()) {
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str");
    }
    return true;
  }
 else {
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str" + candidate);
    }
  }
  Set<String> contracts=candidate.getAdvertisedContracts();
  if (contracts == null)   return true;
  Map<String,List<String>> md=candidate.getMetadata();
  if (LOG.isLoggable(Level.FINE)) {
    Iterator<Map.Entry<String,List<String>>> itr=md.entrySet().iterator();
    while (itr.hasNext()) {
      Map.Entry<String,List<String>> entry=itr.next();
      String k=entry.getKey();
      for (      String v : entry.getValue()) {
        LOG.fine("String_Node_Str" + k + "String_Node_Str"+ v);
      }
    }
  }
  Permission perm=null;
  List<String> names=md.get(Secure.NAME);
  if (names == null || names.isEmpty()) {
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str");
    }
    perm=getAccessPermision(Secure.DEFAULT_PERM_NAME,null);
  }
 else {
    String permName=names.get(0);
    perm=getAccessPermision(permName,null);
  }
  if (LOG.isLoggable(Level.FINE)) {
    LOG.fine("String_Node_Str" + perm);
  }
  boolean check_result=false;
  if (injectee == null) {
    Class caller=getServiceLookupCaller();
    check_result=checkPerm(perm,caller);
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str" + perm + "String_Node_Str"+ check_result);
    }
  }
 else {
    check_result=validateInjection(candidate,injectee,perm);
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("String_Node_Str" + perm + "String_Node_Str"+ check_result);
    }
  }
  return check_result;
}