Simplify boolean returns
Simplify boolean returns of the form:
if (b) {
return true;
} else {
return false;
}
to:
return b;
Issue gh-8945
This commit is contained in:
@@ -68,14 +68,9 @@ public class AuthenticatedVoter implements AccessDecisionVoter<Object> {
|
||||
|
||||
@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()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,12 +68,7 @@ public class RoleVoter implements AccessDecisionVoter<Object> {
|
||||
|
||||
@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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-6
@@ -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) {
|
||||
|
||||
@@ -37,12 +37,7 @@ public class DenyAgainVoter implements AccessDecisionVoter<Object> {
|
||||
|
||||
@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
|
||||
|
||||
@@ -39,12 +39,7 @@ public class DenyVoter implements AccessDecisionVoter<Object> {
|
||||
|
||||
@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
|
||||
|
||||
Reference in New Issue
Block a user