Fixed major issues reported by sonar (Simplify Boolean Return)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@64825 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-03-18 23:22:27 +00:00
parent 6af1e78e54
commit 4f3c08a780
2 changed files with 20 additions and 20 deletions

View File

@@ -57,6 +57,7 @@ import org.alfresco.service.cmr.search.PermissionEvaluationMode;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.security.AccessStatus;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
@@ -76,16 +77,15 @@ public class RMAfterInvocationProvider extends RMSecurityCommon
private long maxPermissionCheckTimeMillis;
public boolean supports(ConfigAttribute attribute)
public boolean supports(ConfigAttribute configAttribute)
{
if ((attribute.getAttribute() != null) && (attribute.getAttribute().startsWith(AFTER_RM)))
boolean supports = false;
String attribute = configAttribute.getAttribute();
if (StringUtils.isNotBlank(attribute) && attribute.startsWith(AFTER_RM))
{
return true;
}
else
{
return false;
supports = true;
}
return supports;
}
@SuppressWarnings("rawtypes")

View File

@@ -36,6 +36,7 @@ import org.alfresco.repo.transaction.TransactionalResourceHelper;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
@@ -90,22 +91,21 @@ public class RMEntryVoter extends RMSecurityCommon
* @see net.sf.acegisecurity.vote.AccessDecisionVoter#supports(net.sf.acegisecurity.ConfigAttribute)
*/
@Override
public boolean supports(ConfigAttribute attribute)
public boolean supports(ConfigAttribute configAttribute)
{
if ((attribute.getAttribute() != null) &&
(attribute.getAttribute().equals(ConfigAttributeDefinition.RM_ABSTAIN) ||
attribute.getAttribute().equals(ConfigAttributeDefinition.RM_QUERY) ||
attribute.getAttribute().equals(ConfigAttributeDefinition.RM_ALLOW) ||
attribute.getAttribute().equals(ConfigAttributeDefinition.RM_DENY) ||
attribute.getAttribute().startsWith(ConfigAttributeDefinition.RM_CAP) ||
attribute.getAttribute().startsWith(ConfigAttributeDefinition.RM)))
boolean supports = false;
String attribute = configAttribute.getAttribute();
if (StringUtils.isNotBlank(attribute) &&
(attribute.equals(ConfigAttributeDefinition.RM_ABSTAIN) ||
attribute.equals(ConfigAttributeDefinition.RM_QUERY) ||
attribute.equals(ConfigAttributeDefinition.RM_ALLOW) ||
attribute.equals(ConfigAttributeDefinition.RM_DENY) ||
attribute.startsWith(ConfigAttributeDefinition.RM_CAP) ||
attribute.startsWith(ConfigAttributeDefinition.RM)))
{
return true;
}
else
{
return false;
supports = true;
}
return supports;
}
/**