Fixed major issues (Simplify Boolean Expression) reported in Sonar

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@89713 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-11-01 18:18:54 +00:00
parent f48a8e1c7b
commit 2db964e75c
6 changed files with 24 additions and 24 deletions

View File

@@ -301,10 +301,10 @@ public class DeclarativeCapability extends AbstractCapability
else
{
// Check we are dealing with a file plan component
if (getFilePlanService().isFilePlanComponent(nodeRef) == true)
if (getFilePlanService().isFilePlanComponent(nodeRef))
{
// Check the kind of the object, the permissions and the conditions
if (checkKinds(nodeRef) == true && checkPermissions(nodeRef) == true && checkConditions(nodeRef) == true)
if (checkKinds(nodeRef) && checkPermissions(nodeRef) && checkConditions(nodeRef))
{
// Opportunity for child implementations to extend
result = evaluateImpl(nodeRef);
@@ -319,7 +319,7 @@ public class DeclarativeCapability extends AbstractCapability
result = onEvaluate(nodeRef, result);
// log access denied to help with debug
if (LOGGER.isDebugEnabled() == true && AccessDecisionVoter.ACCESS_DENIED == result)
if (LOGGER.isDebugEnabled() && AccessDecisionVoter.ACCESS_DENIED == result)
{
LOGGER.debug("Capability " + getName() + " returned an Access Denied result during evaluation of node " + nodeRef.toString());
}

View File

@@ -348,7 +348,7 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
containerType,
properties).getChildRef();
// if (inheritPermissions == false)
// if (!inheritPermissions)
// {
// set inheritance to false
getPermissionService().setInheritParentPermissions(container, false);

View File

@@ -152,7 +152,7 @@ public abstract class ExtendedSecurityBaseDynamicAuthority implements DynamicAut
}
else
{
if (getNodeService().hasAspect(nodeRef, ASPECT_EXTENDED_SECURITY) == true)
if (getNodeService().hasAspect(nodeRef, ASPECT_EXTENDED_SECURITY))
{
Set<String> authorities = getAuthorites(nodeRef);
if (authorities != null)

View File

@@ -388,7 +388,7 @@ public class RecordableVersionServiceImpl extends Version2ServiceImpl
}
// If the auditable aspect is not there then add it to the 'version' node (after original aspects have been frozen)
if (dbNodeService.hasAspect(versionNodeRef, ContentModel.ASPECT_AUDITABLE) == false)
if (!dbNodeService.hasAspect(versionNodeRef, ContentModel.ASPECT_AUDITABLE))
{
dbNodeService.addAspect(versionNodeRef, ContentModel.ASPECT_AUDITABLE, null);
}

View File

@@ -118,15 +118,15 @@ public class RMPermissionServiceImpl extends PermissionServiceImpl
public AccessStatus hasPermission(NodeRef nodeRef, String perm)
{
AccessStatus acs = super.hasPermission(nodeRef, perm);
if (AccessStatus.DENIED.equals(acs) == true &&
PermissionService.READ.equals(perm) == true &&
nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT) == true)
if (AccessStatus.DENIED.equals(acs) &&
PermissionService.READ.equals(perm) &&
nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT))
{
return super.hasPermission(nodeRef, RMPermissionModel.READ_RECORDS);
}
else if (AccessStatus.DENIED.equals(acs) == true &&
PermissionService.WRITE.equals(perm) == true &&
nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT) == true)
else if (AccessStatus.DENIED.equals(acs) &&
PermissionService.WRITE.equals(perm) &&
nodeService.hasAspect(nodeRef, RecordsManagementModel.ASPECT_FILE_PLAN_COMPONENT))
{
return super.hasPermission(nodeRef, RMPermissionModel.FILE_RECORDS);
}

View File

@@ -34,7 +34,7 @@ public abstract class BaseHoldWebScriptWithContentUnitTest extends BaseHoldWebSc
boolean bFirst = true;
for (NodeRef nodeRef : nodeRefs)
{
if (bFirst == false)
if (!bFirst)
{
builder.append(",");
}
@@ -61,7 +61,7 @@ public abstract class BaseHoldWebScriptWithContentUnitTest extends BaseHoldWebSc
boolean bFirst = true;
for (NodeRef hold : holds)
{
if (bFirst == false)
if (!bFirst)
{
builder.append(",");
}