From eddcd1622f070237f6172806783606c72696384d Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Fri, 9 Aug 2019 00:40:13 +0200 Subject: [PATCH] Type parameter extends Object Reports any type parameters and wildcard type arguments explicitly declared to extend java.lang.Object. --- .../annotation/AbstractConfiguredSecurityBuilder.java | 4 ++-- .../config/annotation/SecurityConfigurerAdapter.java | 4 ++-- .../configuration/GlobalMethodSecurityConfiguration.java | 2 +- .../config/annotation/web/builders/HttpSecurity.java | 4 ++-- .../web/configuration/WebSecurityConfigurerAdapter.java | 6 +++--- .../web/configurers/AbstractInterceptUrlConfigurer.java | 4 ++-- .../configurers/ExpressionUrlAuthorizationConfigurer.java | 4 ++-- .../web/configurers/UrlAuthorizationConfigurer.java | 4 ++-- .../AbstractSecurityWebSocketMessageBrokerConfigurer.java | 2 +- .../security/access/vote/AbstractAccessDecisionManager.java | 6 +++--- .../security/access/vote/AffirmativeBased.java | 2 +- .../security/access/vote/ConsensusBased.java | 2 +- .../security/access/vote/UnanimousBased.java | 2 +- .../security/messaging/util/matcher/MessageMatcher.java | 2 +- .../util/matcher/SimpDestinationMessageMatcher.java | 4 ++-- .../messaging/util/matcher/SimpMessageTypeMatcher.java | 2 +- 16 files changed, 27 insertions(+), 27 deletions(-) diff --git a/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java b/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java index 9ee25268cf..8d719bef86 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java +++ b/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java @@ -58,7 +58,7 @@ public abstract class AbstractConfiguredSecurityBuilder>, List>> configurers = new LinkedHashMap<>(); private final List> configurersAddedInInitializing = new ArrayList<>(); - private final Map, Object> sharedObjects = new HashMap<>(); + private final Map, Object> sharedObjects = new HashMap<>(); private final boolean allowConfigurersOfSameType; @@ -174,7 +174,7 @@ public abstract class AbstractConfiguredSecurityBuilder, Object> getSharedObjects() { + public Map, Object> getSharedObjects() { return Collections.unmodifiableMap(this.sharedObjects); } diff --git a/config/src/main/java/org/springframework/security/config/annotation/SecurityConfigurerAdapter.java b/config/src/main/java/org/springframework/security/config/annotation/SecurityConfigurerAdapter.java index a68dd2c409..1d74d2c202 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/SecurityConfigurerAdapter.java +++ b/config/src/main/java/org/springframework/security/config/annotation/SecurityConfigurerAdapter.java @@ -111,7 +111,7 @@ public abstract class SecurityConfigurerAdapter> */ private static final class CompositeObjectPostProcessor implements ObjectPostProcessor { - private List> postProcessors = new ArrayList<>(); + private List> postProcessors = new ArrayList<>(); @SuppressWarnings({ "rawtypes", "unchecked" }) public Object postProcess(Object object) { @@ -132,7 +132,7 @@ public abstract class SecurityConfigurerAdapter> * @return true if the {@link ObjectPostProcessor} was added, else false */ private boolean addObjectPostProcessor( - ObjectPostProcessor objectPostProcessor) { + ObjectPostProcessor objectPostProcessor) { boolean result = this.postProcessors.add(objectPostProcessor); Collections.sort(postProcessors, AnnotationAwareOrderComparator.INSTANCE); return result; diff --git a/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java b/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java index a27fbb2441..91aa83b20b 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java +++ b/config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java @@ -241,7 +241,7 @@ public class GlobalMethodSecurityConfiguration * @return the {@link AccessDecisionManager} to use */ protected AccessDecisionManager accessDecisionManager() { - List> decisionVoters = new ArrayList<>(); + List> decisionVoters = new ArrayList<>(); ExpressionBasedPreInvocationAdvice expressionAdvice = new ExpressionBasedPreInvocationAdvice(); expressionAdvice.setExpressionHandler(getExpressionHandler()); if (prePostEnabled()) { diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java index 69bc3ab70c..cb713f9b5c 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java @@ -138,11 +138,11 @@ public final class HttpSecurity extends @SuppressWarnings("unchecked") public HttpSecurity(ObjectPostProcessor objectPostProcessor, AuthenticationManagerBuilder authenticationBuilder, - Map, Object> sharedObjects) { + Map, Object> sharedObjects) { super(objectPostProcessor); Assert.notNull(authenticationBuilder, "authenticationBuilder cannot be null"); setSharedObject(AuthenticationManagerBuilder.class, authenticationBuilder); - for (Map.Entry, Object> entry : sharedObjects + for (Map.Entry, Object> entry : sharedObjects .entrySet()) { setSharedObject((Class) entry.getKey(), entry.getValue()); } diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java index ecabda57c8..46e5fce86f 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.java @@ -201,7 +201,7 @@ public abstract class WebSecurityConfigurerAdapter implements AuthenticationManager authenticationManager = authenticationManager(); authenticationBuilder.parentAuthenticationManager(authenticationManager); authenticationBuilder.authenticationEventPublisher(eventPublisher); - Map, Object> sharedObjects = createSharedObjects(); + Map, Object> sharedObjects = createSharedObjects(); http = new HttpSecurity(objectPostProcessor, authenticationBuilder, sharedObjects); @@ -412,8 +412,8 @@ public abstract class WebSecurityConfigurerAdapter implements * * @return the shared Objects */ - private Map, Object> createSharedObjects() { - Map, Object> sharedObjects = new HashMap<>(); + private Map, Object> createSharedObjects() { + Map, Object> sharedObjects = new HashMap<>(); sharedObjects.putAll(localConfigureAuthenticationBldr.getSharedObjects()); sharedObjects.put(UserDetailsService.class, userDetailsService()); sharedObjects.put(ApplicationContext.class, context); diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractInterceptUrlConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractInterceptUrlConfigurer.java index 1a882c05f5..36f9f7b481 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractInterceptUrlConfigurer.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractInterceptUrlConfigurer.java @@ -108,7 +108,7 @@ abstract class AbstractInterceptUrlConfigurer> getDecisionVoters(H http); + abstract List> getDecisionVoters(H http); abstract class AbstractInterceptUrlRegistry, T> extends AbstractConfigAttributeRequestMatcherRegistry { @@ -195,4 +195,4 @@ abstract class AbstractInterceptUrlConfigurer> getDecisionVoters(H http) { - List> decisionVoters = new ArrayList<>(); + final List> getDecisionVoters(H http) { + List> decisionVoters = new ArrayList<>(); WebExpressionVoter expressionVoter = new WebExpressionVoter(); expressionVoter.setExpressionHandler(getExpressionHandler(http)); decisionVoters.add(expressionVoter); diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurer.java index 6f68bc85f6..b546b5b742 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurer.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/UrlAuthorizationConfigurer.java @@ -172,8 +172,8 @@ public final class UrlAuthorizationConfigurer> */ @Override @SuppressWarnings("rawtypes") - final List> getDecisionVoters(H http) { - List> decisionVoters = new ArrayList<>(); + final List> getDecisionVoters(H http) { + List> decisionVoters = new ArrayList<>(); decisionVoters.add(new RoleVoter()); decisionVoters.add(new AuthenticatedVoter()); return decisionVoters; diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurer.java index 97e43b2703..0bb45a614f 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurer.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/socket/AbstractSecurityWebSocketMessageBrokerConfigurer.java @@ -159,7 +159,7 @@ public abstract class AbstractSecurityWebSocketMessageBrokerConfigurer extends MessageExpressionVoter voter = new MessageExpressionVoter<>(); voter.setExpressionHandler(getMessageExpressionHandler()); - List> voters = new ArrayList<>(); + List> voters = new ArrayList<>(); voters.add(voter); AffirmativeBased manager = new AffirmativeBased(voters); diff --git a/core/src/main/java/org/springframework/security/access/vote/AbstractAccessDecisionManager.java b/core/src/main/java/org/springframework/security/access/vote/AbstractAccessDecisionManager.java index f8c7cb362d..e68629ab93 100644 --- a/core/src/main/java/org/springframework/security/access/vote/AbstractAccessDecisionManager.java +++ b/core/src/main/java/org/springframework/security/access/vote/AbstractAccessDecisionManager.java @@ -45,14 +45,14 @@ public abstract class AbstractAccessDecisionManager implements AccessDecisionMan // ================================================================================================ protected final Log logger = LogFactory.getLog(getClass()); - private List> decisionVoters; + private List> decisionVoters; protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor(); private boolean allowIfAllAbstainDecisions = false; protected AbstractAccessDecisionManager( - List> decisionVoters) { + List> decisionVoters) { Assert.notEmpty(decisionVoters, "A list of AccessDecisionVoters is required"); this.decisionVoters = decisionVoters; } @@ -72,7 +72,7 @@ public abstract class AbstractAccessDecisionManager implements AccessDecisionMan } } - public List> getDecisionVoters() { + public List> getDecisionVoters() { return this.decisionVoters; } diff --git a/core/src/main/java/org/springframework/security/access/vote/AffirmativeBased.java b/core/src/main/java/org/springframework/security/access/vote/AffirmativeBased.java index 3f68542110..30f27da022 100644 --- a/core/src/main/java/org/springframework/security/access/vote/AffirmativeBased.java +++ b/core/src/main/java/org/springframework/security/access/vote/AffirmativeBased.java @@ -30,7 +30,7 @@ import org.springframework.security.core.Authentication; */ public class AffirmativeBased extends AbstractAccessDecisionManager { - public AffirmativeBased(List> decisionVoters) { + public AffirmativeBased(List> decisionVoters) { super(decisionVoters); } diff --git a/core/src/main/java/org/springframework/security/access/vote/ConsensusBased.java b/core/src/main/java/org/springframework/security/access/vote/ConsensusBased.java index 7e97ba342d..2b4be013a3 100644 --- a/core/src/main/java/org/springframework/security/access/vote/ConsensusBased.java +++ b/core/src/main/java/org/springframework/security/access/vote/ConsensusBased.java @@ -38,7 +38,7 @@ public class ConsensusBased extends AbstractAccessDecisionManager { private boolean allowIfEqualGrantedDeniedDecisions = true; - public ConsensusBased(List> decisionVoters) { + public ConsensusBased(List> decisionVoters) { super(decisionVoters); } diff --git a/core/src/main/java/org/springframework/security/access/vote/UnanimousBased.java b/core/src/main/java/org/springframework/security/access/vote/UnanimousBased.java index aeb33ba304..af7f8eae9d 100644 --- a/core/src/main/java/org/springframework/security/access/vote/UnanimousBased.java +++ b/core/src/main/java/org/springframework/security/access/vote/UnanimousBased.java @@ -32,7 +32,7 @@ import org.springframework.security.core.Authentication; */ public class UnanimousBased extends AbstractAccessDecisionManager { - public UnanimousBased(List> decisionVoters) { + public UnanimousBased(List> decisionVoters) { super(decisionVoters); } diff --git a/messaging/src/main/java/org/springframework/security/messaging/util/matcher/MessageMatcher.java b/messaging/src/main/java/org/springframework/security/messaging/util/matcher/MessageMatcher.java index 2ca4d632e1..41e2a36229 100644 --- a/messaging/src/main/java/org/springframework/security/messaging/util/matcher/MessageMatcher.java +++ b/messaging/src/main/java/org/springframework/security/messaging/util/matcher/MessageMatcher.java @@ -37,7 +37,7 @@ public interface MessageMatcher { */ MessageMatcher ANY_MESSAGE = new MessageMatcher() { @Override - public boolean matches(Message message) { + public boolean matches(Message message) { return true; } diff --git a/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpDestinationMessageMatcher.java b/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpDestinationMessageMatcher.java index 625902a404..0db50c1982 100644 --- a/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpDestinationMessageMatcher.java +++ b/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpDestinationMessageMatcher.java @@ -120,7 +120,7 @@ public final class SimpDestinationMessageMatcher implements MessageMatcher message) { + public boolean matches(Message message) { if (!messageTypeMatcher.matches(message)) { return false; } @@ -131,7 +131,7 @@ public final class SimpDestinationMessageMatcher implements MessageMatcher extractPathVariables(Message message){ + public Map extractPathVariables(Message message){ final String destination = SimpMessageHeaderAccessor.getDestination(message .getHeaders()); return destination != null ? matcher.extractUriTemplateVariables(pattern, destination) diff --git a/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpMessageTypeMatcher.java b/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpMessageTypeMatcher.java index 7bf6b03f04..24a66b8f3e 100644 --- a/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpMessageTypeMatcher.java +++ b/messaging/src/main/java/org/springframework/security/messaging/util/matcher/SimpMessageTypeMatcher.java @@ -45,7 +45,7 @@ public class SimpMessageTypeMatcher implements MessageMatcher { } @Override - public boolean matches(Message message) { + public boolean matches(Message message) { MessageHeaders headers = message.getHeaders(); SimpMessageType messageType = SimpMessageHeaderAccessor.getMessageType(headers);