mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -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());
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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(",");
|
||||
}
|
||||
|
Reference in New Issue
Block a user