Program: 14946
Project: 14946
Buggy source:
@Override public void evaluateAuthorization(String resourceType,String resourceName,Account resourceAccount,String action,User requestUser,Map<Contract.Type,Contract> contracts) throws AuthException {
  try {
    ContractKeyEvaluator contractEval=new ContractKeyEvaluator(contracts);
    CachedKeyEvaluator keyEval=new CachedKeyEvaluator();
    if (!requestUser.isSystemAdmin() && !requestUser.isSystemInternal()) {
      String userId=requestUser.getUserId();
      Account account=requestUser.getAccount();
      Decision decision=processAuthorizations(lookupGlobalAuthorizations(resourceType,account),action,resourceName,keyEval,contractEval);
      if ((decision == Decision.DENY) || (decision == Decision.DEFAULT && resourceAccount != null && resourceAccount.getAccountNumber() != null && !resourceAccount.getAccountNumber().equals(account.getAccountNumber()))) {
        LOG.debug("String_Node_Str" + decision);
        throw new AuthException(AuthException.ACCESS_DENIED);
      }
      if (!requestUser.isAccountAdmin()) {
        decision=processAuthorizations(lookupLocalAuthorizations(resourceType,requestUser),action,resourceName,keyEval,contractEval);
        if (decision == Decision.DENY || decision == Decision.DEFAULT) {
          LOG.debug("String_Node_Str" + decision);
          throw new AuthException(AuthException.ACCESS_DENIED);
        }
      }
    }
  }
 catch (  AuthException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Throwable e) {
    LOG.debug(e,e);
    throw new AuthException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void evaluateAuthorization(String resourceType,String resourceName,Account resourceAccount,String action,User requestUser,Map<Contract.Type,Contract> contracts) throws AuthException {
  try {
    ContractKeyEvaluator contractEval=new ContractKeyEvaluator(contracts);
    CachedKeyEvaluator keyEval=new CachedKeyEvaluator();
    resourceName=resourceName.toLowerCase();
    action=action.toLowerCase();
    if (!requestUser.isSystemAdmin() && !requestUser.isSystemInternal()) {
      String userId=requestUser.getUserId();
      Account account=requestUser.getAccount();
      Decision decision=processAuthorizations(lookupGlobalAuthorizations(resourceType,account),action,resourceName,keyEval,contractEval);
      if ((decision == Decision.DENY) || (decision == Decision.DEFAULT && resourceAccount != null && resourceAccount.getAccountNumber() != null && !resourceAccount.getAccountNumber().equals(account.getAccountNumber()))) {
        LOG.debug("String_Node_Str" + decision);
        throw new AuthException(AuthException.ACCESS_DENIED);
      }
      if (!requestUser.isAccountAdmin()) {
        decision=processAuthorizations(lookupLocalAuthorizations(resourceType,requestUser),action,resourceName,keyEval,contractEval);
        if (decision == Decision.DENY || decision == Decision.DEFAULT) {
          LOG.debug("String_Node_Str" + decision);
          throw new AuthException(AuthException.ACCESS_DENIED);
        }
      }
    }
  }
 catch (  AuthException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Throwable e) {
    LOG.debug(e,e);
    throw new AuthException("String_Node_Str",e);
  }
}