diff --git a/core/src/main/java/org/springframework/security/access/vote/AuthenticatedVoter.java b/core/src/main/java/org/springframework/security/access/vote/AuthenticatedVoter.java index 606f24365b..364485b8ec 100644 --- a/core/src/main/java/org/springframework/security/access/vote/AuthenticatedVoter.java +++ b/core/src/main/java/org/springframework/security/access/vote/AuthenticatedVoter.java @@ -68,14 +68,9 @@ public class AuthenticatedVoter implements AccessDecisionVoter { @Override public boolean supports(ConfigAttribute attribute) { - if ((attribute.getAttribute() != null) && (IS_AUTHENTICATED_FULLY.equals(attribute.getAttribute()) + return (attribute.getAttribute() != null) && (IS_AUTHENTICATED_FULLY.equals(attribute.getAttribute()) || IS_AUTHENTICATED_REMEMBERED.equals(attribute.getAttribute()) - || IS_AUTHENTICATED_ANONYMOUSLY.equals(attribute.getAttribute()))) { - return true; - } - else { - return false; - } + || IS_AUTHENTICATED_ANONYMOUSLY.equals(attribute.getAttribute())); } /** diff --git a/core/src/main/java/org/springframework/security/access/vote/RoleVoter.java b/core/src/main/java/org/springframework/security/access/vote/RoleVoter.java index 1ea83e03c3..e20808eb73 100644 --- a/core/src/main/java/org/springframework/security/access/vote/RoleVoter.java +++ b/core/src/main/java/org/springframework/security/access/vote/RoleVoter.java @@ -68,12 +68,7 @@ public class RoleVoter implements AccessDecisionVoter { @Override public boolean supports(ConfigAttribute attribute) { - if ((attribute.getAttribute() != null) && attribute.getAttribute().startsWith(getRolePrefix())) { - return true; - } - else { - return false; - } + return (attribute.getAttribute() != null) && attribute.getAttribute().startsWith(getRolePrefix()); } /** diff --git a/core/src/main/java/org/springframework/security/core/userdetails/memory/UserAttribute.java b/core/src/main/java/org/springframework/security/core/userdetails/memory/UserAttribute.java index 309b16e72d..8e3643a223 100644 --- a/core/src/main/java/org/springframework/security/core/userdetails/memory/UserAttribute.java +++ b/core/src/main/java/org/springframework/security/core/userdetails/memory/UserAttribute.java @@ -76,12 +76,7 @@ public class UserAttribute { } public boolean isValid() { - if ((this.password != null) && (this.authorities.size() > 0)) { - return true; - } - else { - return false; - } + return (this.password != null) && (this.authorities.size() > 0); } public void setEnabled(boolean enabled) { diff --git a/core/src/test/java/org/springframework/security/access/vote/DenyAgainVoter.java b/core/src/test/java/org/springframework/security/access/vote/DenyAgainVoter.java index 758e3059a7..f6e2977982 100644 --- a/core/src/test/java/org/springframework/security/access/vote/DenyAgainVoter.java +++ b/core/src/test/java/org/springframework/security/access/vote/DenyAgainVoter.java @@ -37,12 +37,7 @@ public class DenyAgainVoter implements AccessDecisionVoter { @Override public boolean supports(ConfigAttribute attribute) { - if ("DENY_AGAIN_FOR_SURE".equals(attribute.getAttribute())) { - return true; - } - else { - return false; - } + return "DENY_AGAIN_FOR_SURE".equals(attribute.getAttribute()); } @Override diff --git a/core/src/test/java/org/springframework/security/access/vote/DenyVoter.java b/core/src/test/java/org/springframework/security/access/vote/DenyVoter.java index 13bbada456..ae548752f1 100644 --- a/core/src/test/java/org/springframework/security/access/vote/DenyVoter.java +++ b/core/src/test/java/org/springframework/security/access/vote/DenyVoter.java @@ -39,12 +39,7 @@ public class DenyVoter implements AccessDecisionVoter { @Override public boolean supports(ConfigAttribute attribute) { - if ("DENY_FOR_SURE".equals(attribute.getAttribute())) { - return true; - } - else { - return false; - } + return "DENY_FOR_SURE".equals(attribute.getAttribute()); } @Override diff --git a/etc/checkstyle/checkstyle-suppressions.xml b/etc/checkstyle/checkstyle-suppressions.xml index 7f80bd3ecc..a0d4fa92c7 100644 --- a/etc/checkstyle/checkstyle-suppressions.xml +++ b/etc/checkstyle/checkstyle-suppressions.xml @@ -3,7 +3,6 @@ "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "https://checkstyle.org/dtds/suppressions_1_2.dtd"> - diff --git a/web/src/test/java/org/springframework/security/web/access/channel/ChannelDecisionManagerImplTests.java b/web/src/test/java/org/springframework/security/web/access/channel/ChannelDecisionManagerImplTests.java index e2bd4810de..41d60e69c7 100644 --- a/web/src/test/java/org/springframework/security/web/access/channel/ChannelDecisionManagerImplTests.java +++ b/web/src/test/java/org/springframework/security/web/access/channel/ChannelDecisionManagerImplTests.java @@ -220,12 +220,7 @@ public class ChannelDecisionManagerImplTests { @Override public boolean supports(ConfigAttribute attribute) { - if (attribute.getAttribute().equals(this.configAttribute)) { - return true; - } - else { - return false; - } + return attribute.getAttribute().equals(this.configAttribute); } } diff --git a/web/src/test/java/org/springframework/security/web/access/channel/ChannelProcessingFilterTests.java b/web/src/test/java/org/springframework/security/web/access/channel/ChannelProcessingFilterTests.java index 64ad763950..f539e6eafe 100644 --- a/web/src/test/java/org/springframework/security/web/access/channel/ChannelProcessingFilterTests.java +++ b/web/src/test/java/org/springframework/security/web/access/channel/ChannelProcessingFilterTests.java @@ -170,12 +170,7 @@ public class ChannelProcessingFilterTests { @Override public boolean supports(ConfigAttribute attribute) { - if (attribute.getAttribute().equals(this.supportAttribute)) { - return true; - } - else { - return false; - } + return attribute.getAttribute().equals(this.supportAttribute); } }