Program: 14776
Project: 14776
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();
    resourceName=resourceName.toLowerCase();
    action=action.toLowerCase();
    if (!requestUser.isSystemAdmin()) {
      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 (  Exception 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()) {
      if (!requestUser.isEnabled()) {
        LOG.debug("String_Node_Str");
        throw new AuthException(AuthException.ACCESS_DENIED);
      }
      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 (  Exception e) {
    LOG.debug(e,e);
    throw new AuthException("String_Node_Str",e);
  }
}