mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fixed minor issues ("Collapsible If Statements") reported in Sonar
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@71949 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -444,14 +444,11 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
||||
result.add(item);
|
||||
}
|
||||
}
|
||||
else if (filePlanService.isRecordCategory(item))
|
||||
{
|
||||
if (getAssociatedDispositionScheduleImpl(item) == null)
|
||||
else if (filePlanService.isRecordCategory(item) && getAssociatedDispositionScheduleImpl(item) == null)
|
||||
{
|
||||
result.addAll(getDisposableItemsImpl(isRecordLevelDisposition, item));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -203,10 +203,8 @@ public class DispositionProperty extends BaseBehaviourBean
|
||||
if (dispositionAction != null)
|
||||
{
|
||||
DispositionActionDefinition daDefinition = dispositionAction.getDispositionActionDefinition();
|
||||
if (daDefinition != null)
|
||||
{
|
||||
// check whether the next disposition action matches this disposition property
|
||||
if (propertyName.equals(daDefinition.getPeriodProperty()))
|
||||
if (daDefinition != null && propertyName.equals(daDefinition.getPeriodProperty()))
|
||||
{
|
||||
Period period = daDefinition.getPeriod();
|
||||
Date updatedAsOf = period.getNextDate(updatedDateValue);
|
||||
@@ -217,7 +215,6 @@ public class DispositionProperty extends BaseBehaviourBean
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// throw an exception if the property is being 'cleared'
|
||||
|
@@ -148,9 +148,7 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
|
||||
SiteService siteService = getSiteService();
|
||||
|
||||
SiteInfo siteInfo = siteService.getSite(siteId);
|
||||
if (siteInfo != null)
|
||||
{
|
||||
if (siteService.hasContainer(siteId, FILE_PLAN_CONTAINER))
|
||||
if (siteInfo != null && siteService.hasContainer(siteId, FILE_PLAN_CONTAINER))
|
||||
{
|
||||
NodeRef nodeRef = siteService.getContainer(siteId, FILE_PLAN_CONTAINER);
|
||||
if (instanceOf(nodeRef, TYPE_FILE_PLAN))
|
||||
@@ -158,7 +156,6 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
|
||||
filePlan = nodeRef;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return filePlan;
|
||||
}
|
||||
|
@@ -345,20 +345,18 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
|
||||
// as read only
|
||||
QName qname = QName.createQName(prefixName, namespaceService);
|
||||
Serializable value = nodeService.getProperty(nodeRef, qname);
|
||||
if (value != null)
|
||||
{
|
||||
if (prefixName.equals("cm:title") ||
|
||||
if (value != null &&
|
||||
(prefixName.equals("cm:title") ||
|
||||
prefixName.equals("cm:author") ||
|
||||
prefixName.equals("dod:originator") ||
|
||||
prefixName.equals("dod:publicationDate") ||
|
||||
prefixName.equals("dod:dateReceived") ||
|
||||
prefixName.equals("dod:address") ||
|
||||
prefixName.equals("dod:otherAddress"))
|
||||
prefixName.equals("dod:otherAddress")))
|
||||
{
|
||||
fieldDef.setProtectedField(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
|
@@ -326,17 +326,14 @@ public class FilePlanPermissionServiceImpl extends ServiceBaseImpl
|
||||
for (AccessPermission perm : origionalRecordPerms)
|
||||
{
|
||||
if (!ExtendedReaderDynamicAuthority.EXTENDED_READER.equals(perm.getAuthority()) &&
|
||||
!ExtendedWriterDynamicAuthority.EXTENDED_WRITER.equals(perm.getAuthority()))
|
||||
{
|
||||
if ((perm.getPermission().equals(RMPermissionModel.FILING) ||
|
||||
perm.getPermission().equals(RMPermissionModel.FILE_RECORDS)) &&
|
||||
!ExtendedWriterDynamicAuthority.EXTENDED_WRITER.equals(perm.getAuthority()) &&
|
||||
(perm.getPermission().equals(RMPermissionModel.FILING) || perm.getPermission().equals(RMPermissionModel.FILE_RECORDS)) &&
|
||||
!origionalParentPerms.contains(perm))
|
||||
{
|
||||
// then we can assume this is a permission we want to preserve
|
||||
keepPerms.add(perm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clear all existing permissions and start again
|
||||
permissionService.deletePermissions(record);
|
||||
|
@@ -46,14 +46,11 @@ public final class RmDictionaryWebServiceUtils
|
||||
if (StringUtils.isNotBlank(siteId))
|
||||
{
|
||||
SiteInfo site = siteService.getSite(siteId);
|
||||
if (site != null)
|
||||
{
|
||||
if (site.getSitePreset().equals(SITE_PRESET))
|
||||
if (site != null && site.getSitePreset().equals(SITE_PRESET))
|
||||
{
|
||||
isRmSite = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isRmSite;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user