Program: 166402
Project: 166402
Buggy source:
public RangerPolicyEngineImpl(ServicePolicies servicePolicies,RangerPolicyEngineOptions options){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + servicePolicies + "String_Node_Str"+ options+ "String_Node_Str");
  }
  if (options == null) {
    options=new RangerPolicyEngineOptions();
  }
  policyRepository=new RangerPolicyRepository(servicePolicies,options);
  ServicePolicies.TagPolicies tagPolicies=servicePolicies.getTagPolicies();
  if (!options.disableTagPolicyEvaluation && tagPolicies != null && !StringUtils.isEmpty(tagPolicies.getServiceName()) && tagPolicies.getServiceDef() != null && !CollectionUtils.isEmpty(tagPolicies.getPolicies())) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + tagPolicies.getServiceName());
    }
    tagPolicyRepository=new RangerPolicyRepository(tagPolicies,options,servicePolicies.getServiceDef());
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + servicePolicies.getServiceName());
    }
    tagPolicyRepository=null;
  }
  List<RangerContextEnricher> tmpList;
  List<RangerContextEnricher> tagContextEnrichers=tagPolicyRepository == null ? null : tagPolicyRepository.getContextEnrichers();
  List<RangerContextEnricher> resourceContextEnrichers=policyRepository.getContextEnrichers();
  if (CollectionUtils.isEmpty(tagContextEnrichers)) {
    tmpList=resourceContextEnrichers;
  }
 else   if (CollectionUtils.isEmpty(resourceContextEnrichers)) {
    tmpList=tagContextEnrichers;
  }
 else {
    tmpList=new ArrayList<RangerContextEnricher>(tagContextEnrichers);
    tmpList.addAll(resourceContextEnrichers);
  }
  this.allContextEnrichers=tmpList;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
public RangerPolicyEngineImpl(ServicePolicies servicePolicies,RangerPolicyEngineOptions options){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + servicePolicies + "String_Node_Str"+ options+ "String_Node_Str");
  }
  if (options == null) {
    options=new RangerPolicyEngineOptions();
  }
  policyRepository=new RangerPolicyRepository(servicePolicies,options);
  ServicePolicies.TagPolicies tagPolicies=servicePolicies.getTagPolicies();
  if (!options.disableTagPolicyEvaluation && tagPolicies != null && !StringUtils.isEmpty(tagPolicies.getServiceName()) && tagPolicies.getServiceDef() != null && !CollectionUtils.isEmpty(tagPolicies.getPolicies())) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + tagPolicies.getServiceName());
    }
    tagPolicyRepository=new RangerPolicyRepository(tagPolicies,options,servicePolicies.getServiceDef(),servicePolicies.getServiceName());
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + servicePolicies.getServiceName());
    }
    tagPolicyRepository=null;
  }
  List<RangerContextEnricher> tmpList;
  List<RangerContextEnricher> tagContextEnrichers=tagPolicyRepository == null ? null : tagPolicyRepository.getContextEnrichers();
  List<RangerContextEnricher> resourceContextEnrichers=policyRepository.getContextEnrichers();
  if (CollectionUtils.isEmpty(tagContextEnrichers)) {
    tmpList=resourceContextEnrichers;
  }
 else   if (CollectionUtils.isEmpty(resourceContextEnrichers)) {
    tmpList=tagContextEnrichers;
  }
 else {
    tmpList=new ArrayList<RangerContextEnricher>(tagContextEnrichers);
    tmpList.addAll(resourceContextEnrichers);
  }
  this.allContextEnrichers=tmpList;
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str");
  }
}