Source:
private boolean checkAll(HttpServletRequest request, String cache, Nameable entity, AuthorizationEntity.PluginDecisionPredicate pluginPredicate, AuthorizationEntity.PluginSkippingPredicate skippingPredicate) { if (stack == null) { return true; } if (entity == null) { LOGGER.log(Level.WARNING, "entity was null for request {}", request); return false; } Statistics stats = RuntimeEnvironment.getInstance().getStatistics(); Boolean val; Map<String, Boolean> m = (Map<String, Boolean>) request.getAttribute(cache); if (m == null) { m = new TreeMap<>(); } else if ((val = m.get(entity.getName())) != null) { stats.addRequest("authorization_cache_hits"); return val; } stats.addRequest("authorization_cache_misses"); long time = 0; boolean overallDecision = false; lock.readLock().lock(); try { HttpSession session; if (((session = request.getSession(false)) != null) && isSessionInvalid(session)) { session.invalidate(); stats.addRequest("authorization_sessions_invalidated"); } request.getSession().setAttribute(SESSION_VERSION, getPluginVersion()); time = System.currentTimeMillis(); overallDecision = performCheck(entity, pluginPredicate, skippingPredicate); } finally { lock.readLock().unlock(); } if (time > 0) { time = System.currentTimeMillis() - time; stats.addRequestTime("authorization", time); stats.addRequestTime( String.format("authorization_%s", overallDecision ? "positive" : "negative"), time); stats.addRequestTime( String.format("authorization_%s_of_%s", overallDecision ? "positive" : "negative", entity.getName()), time); stats.addRequestTime( String.format("authorization_of_%s", entity.getName()), time); } m.put(entity.getName(), overallDecision); request.setAttribute(cache, m); return overallDecision; }

Target:
private boolean checkAll(HttpServletRequest request, String cache, Nameable entity, AuthorizationEntity.PluginDecisionPredicate pluginPredicate, AuthorizationEntity.PluginSkippingPredicate skippingPredicate) { if (stack == null) { return true; } if (entity == null) { LOGGER.log(Level.WARNING, "entity was null for request with parameters: {}", request.getParameterMap()); return false; } Statistics stats = RuntimeEnvironment.getInstance().getStatistics(); Boolean val; Map<String, Boolean> m = (Map<String, Boolean>) request.getAttribute(cache); if (m == null) { m = new TreeMap<>(); } else if ((val = m.get(entity.getName())) != null) { stats.addRequest("authorization_cache_hits"); return val; } stats.addRequest("authorization_cache_misses"); long time = 0; boolean overallDecision = false; lock.readLock().lock(); try { HttpSession session; if (((session = request.getSession(false)) != null) && isSessionInvalid(session)) { session.invalidate(); stats.addRequest("authorization_sessions_invalidated"); } request.getSession().setAttribute(SESSION_VERSION, getPluginVersion()); time = System.currentTimeMillis(); overallDecision = performCheck(entity, pluginPredicate, skippingPredicate); } finally { lock.readLock().unlock(); } if (time > 0) { time = System.currentTimeMillis() - time; stats.addRequestTime("authorization", time); stats.addRequestTime( String.format("authorization_%s", overallDecision ? "positive" : "negative"), time); stats.addRequestTime( String.format("authorization_%s_of_%s", overallDecision ? "positive" : "negative", entity.getName()), time); stats.addRequestTime( String.format("authorization_of_%s", entity.getName()), time); } m.put(entity.getName(), overallDecision); request.setAttribute(cache, m); return overallDecision; }