Program: 166258
Project: 166258
Buggy source:
@Override public boolean checkPermission(AccessType accessType,PrivilegedEntity entity,UserGroupInformation ugi){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + accessType + "String_Node_Str"+ toString(entity)+ "String_Node_Str"+ ugi+ "String_Node_Str");
  }
  boolean ret=false;
  RangerYarnPlugin plugin=yarnPlugin;
  RangerYarnAuditHandler auditHandler=null;
  RangerAccessResult result=null;
  String clusterName=yarnPlugin.getClusterName();
  RangerPerfTracer perf=null;
  RangerPerfTracer yarnAclPerf=null;
  if (plugin != null) {
    if (RangerPerfTracer.isPerfTraceEnabled(PERF_YARNAUTH_REQUEST_LOG)) {
      perf=RangerPerfTracer.getPerfTracer(PERF_YARNAUTH_REQUEST_LOG,"String_Node_Str" + entity + "String_Node_Str");
    }
    RangerYarnAccessRequest request=new RangerYarnAccessRequest(entity,getRangerAccessType(accessType),accessType.name(),ugi,clusterName);
    auditHandler=new RangerYarnAuditHandler();
    result=plugin.isAccessAllowed(request,auditHandler);
  }
  if (RangerYarnAuthorizer.yarnAuthEnabled && (result == null || !result.getIsAccessDetermined())) {
    if (RangerPerfTracer.isPerfTraceEnabled(PERF_YARNAUTH_REQUEST_LOG)) {
      yarnAclPerf=RangerPerfTracer.getPerfTracer(PERF_YARNAUTH_REQUEST_LOG,"String_Node_Str" + entity + "String_Node_Str");
    }
    ret=isAllowedByYarnAcl(accessType,entity,ugi,auditHandler);
  }
 else {
    ret=result == null ? false : result.getIsAllowed();
  }
  if (auditHandler != null) {
    auditHandler.flushAudit();
  }
  RangerPerfTracer.log(yarnAclPerf);
  RangerPerfTracer.log(perf);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + accessType + "String_Node_Str"+ toString(entity)+ "String_Node_Str"+ ugi+ "String_Node_Str"+ ret);
  }
  return ret;
}

Fixed version (ground truth):
@Override public boolean checkPermission(AccessType accessType,PrivilegedEntity entity,UserGroupInformation ugi){
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + accessType + "String_Node_Str"+ toString(entity)+ "String_Node_Str"+ ugi+ "String_Node_Str");
  }
  boolean ret=false;
  RangerYarnPlugin plugin=yarnPlugin;
  RangerYarnAuditHandler auditHandler=null;
  RangerAccessResult result=null;
  String clusterName=yarnPlugin.getClusterName();
  RangerPerfTracer perf=null;
  RangerPerfTracer yarnAclPerf=null;
  if (plugin != null) {
    if (RangerPerfTracer.isPerfTraceEnabled(PERF_YARNAUTH_REQUEST_LOG)) {
      perf=RangerPerfTracer.getPerfTracer(PERF_YARNAUTH_REQUEST_LOG,"String_Node_Str" + entity + "String_Node_Str");
    }
    RangerYarnAccessRequest request=new RangerYarnAccessRequest(entity,getRangerAccessType(accessType),accessType.name(),ugi,clusterName);
    auditHandler=new RangerYarnAuditHandler();
    result=plugin.isAccessAllowed(request,auditHandler);
  }
  if (RangerYarnAuthorizer.yarnAuthEnabled && (result == null || !result.getIsAccessDetermined())) {
    if (RangerPerfTracer.isPerfTraceEnabled(PERF_YARNAUTH_REQUEST_LOG)) {
      yarnAclPerf=RangerPerfTracer.getPerfTracer(PERF_YARNAUTH_REQUEST_LOG,"String_Node_Str" + entity + "String_Node_Str");
    }
    ret=isAllowedByYarnAcl(accessType,entity,ugi,auditHandler);
  }
 else {
    ret=result != null && result.getIsAllowed();
  }
  if (auditHandler != null) {
    auditHandler.flushAudit();
  }
  RangerPerfTracer.log(yarnAclPerf);
  RangerPerfTracer.log(perf);
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + accessType + "String_Node_Str"+ toString(entity)+ "String_Node_Str"+ ugi+ "String_Node_Str"+ ret);
  }
  return ret;
}