diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer.java index c9e6216f4f..4f61c93055 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AuthorizeHttpRequestsConfigurer.java @@ -60,7 +60,7 @@ public final class AuthorizeHttpRequestsConfigurer authorizationManagerFactory; + private final AuthorizationManagerFactory authorizationManagerFactory; private ObjectPostProcessor> postProcessor = ObjectPostProcessor .identity(); @@ -85,7 +85,7 @@ public final class AuthorizeHttpRequestsConfigurer this.postProcessor = postProcessor); } - private AuthorizationManagerFactory getAuthorizationManagerFactory( + private AuthorizationManagerFactory getAuthorizationManagerFactory( ApplicationContext context) { ResolvableType authorizationManagerFactoryType = ResolvableType .forClassWithGenerics(AuthorizationManagerFactory.class, RequestAuthorizationContext.class); @@ -134,7 +134,7 @@ public final class AuthorizeHttpRequestsConfigurer matchers, - AuthorizationManager manager) { + AuthorizationManager manager) { for (RequestMatcher matcher : matchers) { this.registry.addMapping(matcher, manager); } @@ -166,13 +166,15 @@ public final class AuthorizeHttpRequestsConfigurer manager) { + private void addMapping(RequestMatcher matcher, + AuthorizationManager manager) { this.unmappedMatchers = null; this.managerBuilder.add(matcher, manager); this.mappingCount++; } - private void addFirst(RequestMatcher matcher, AuthorizationManager manager) { + private void addFirst(RequestMatcher matcher, + AuthorizationManager manager) { this.unmappedMatchers = null; this.managerBuilder.mappings((m) -> m.add(0, new RequestMatcherEntry<>(matcher, manager))); this.mappingCount++; @@ -220,7 +222,7 @@ public final class AuthorizeHttpRequestsConfigurer matchers; - private AuthorizationManagerFactory authorizationManagerFactory; + private AuthorizationManagerFactory authorizationManagerFactory; private boolean not; @@ -231,7 +233,7 @@ public final class AuthorizeHttpRequestsConfigurer matchers, - AuthorizationManagerFactory authorizationManagerFactory) { + AuthorizationManagerFactory authorizationManagerFactory) { this.matchers = matchers; this.authorizationManagerFactory = authorizationManagerFactory; } @@ -241,7 +243,7 @@ public final class AuthorizeHttpRequestsConfigurer authorizationManagerFactory) { + AuthorizationManagerFactory authorizationManagerFactory) { this.authorizationManagerFactory = authorizationManagerFactory; } @@ -403,7 +405,7 @@ public final class AuthorizeHttpRequestsConfigurer manager) { + AuthorizationManager manager) { Assert.notNull(manager, "manager cannot be null"); return (this.not) ? AuthorizeHttpRequestsConfigurer.this.addMapping(this.matchers, AuthorizationManagers.not(manager)) diff --git a/web/src/main/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManager.java b/web/src/main/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManager.java index 8de42775b8..9851f736f7 100644 --- a/web/src/main/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManager.java +++ b/web/src/main/java/org/springframework/security/web/access/intercept/RequestMatcherDelegatingAuthorizationManager.java @@ -55,10 +55,10 @@ public final class RequestMatcherDelegatingAuthorizationManager implements Autho private final Log logger = LogFactory.getLog(getClass()); - private final List>> mappings; + private final List>> mappings; private RequestMatcherDelegatingAuthorizationManager( - List>> mappings) { + List>> mappings) { Assert.notEmpty(mappings, "mappings cannot be empty"); this.mappings = mappings; } @@ -69,12 +69,12 @@ public final class RequestMatcherDelegatingAuthorizationManager implements Autho if (this.logger.isTraceEnabled()) { this.logger.trace(LogMessage.format("Authorizing %s", requestLine(request))); } - for (RequestMatcherEntry> mapping : this.mappings) { + for (RequestMatcherEntry> mapping : this.mappings) { RequestMatcher matcher = mapping.getRequestMatcher(); MatchResult matchResult = matcher.matcher(request); if (matchResult.isMatch()) { - AuthorizationManager manager = mapping.getEntry(); + AuthorizationManager manager = mapping.getEntry(); if (this.logger.isTraceEnabled()) { this.logger.trace( LogMessage.format("Checking authorization on %s using %s", requestLine(request), manager)); @@ -108,7 +108,7 @@ public final class RequestMatcherDelegatingAuthorizationManager implements Autho private boolean anyRequestConfigured; - private final List>> mappings = new ArrayList<>(); + private final List>> mappings = new ArrayList<>(); /** * Maps a {@link RequestMatcher} to an {@link AuthorizationManager}. @@ -116,7 +116,7 @@ public final class RequestMatcherDelegatingAuthorizationManager implements Autho * @param manager the {@link AuthorizationManager} to use * @return the {@link Builder} for further customizations */ - public Builder add(RequestMatcher matcher, AuthorizationManager manager) { + public Builder add(RequestMatcher matcher, AuthorizationManager manager) { Assert.state(!this.anyRequestConfigured, "Can't add mappings after anyRequest"); Assert.notNull(matcher, "matcher cannot be null"); Assert.notNull(manager, "manager cannot be null"); @@ -133,7 +133,7 @@ public final class RequestMatcherDelegatingAuthorizationManager implements Autho * @since 5.7 */ public Builder mappings( - Consumer>>> mappingsConsumer) { + Consumer>>> mappingsConsumer) { Assert.state(!this.anyRequestConfigured, "Can't configure mappings after anyRequest"); Assert.notNull(mappingsConsumer, "mappingsConsumer cannot be null"); mappingsConsumer.accept(this.mappings);