From dd89c7d2f21466285ec35e33940b8ed1ce24de3c Mon Sep 17 00:00:00 2001 From: Sara Aspery Date: Thu, 16 Nov 2017 18:15:59 +0000 Subject: [PATCH] RM-5901 fixes in benchmark driver --- .../disposition/DispositionServiceImpl.java | 20 +++++++++---------- .../api/impl/FilePlanComponentsApiUtils.java | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java index 5cf013e323..55b3582911 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java @@ -132,7 +132,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl /** * Set the dictionary service * - * @param dictionaryServic the dictionary service + * @param dictionaryService the dictionary service */ @Override public void setDictionaryService(DictionaryService dictionaryService) @@ -439,7 +439,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl if (this.nodeService.hasAspect(nodeRef, ASPECT_SCHEDULED)) { List childAssocs = this.nodeService.getChildAssocs(nodeRef, ASSOC_DISPOSITION_SCHEDULE, RegexQNamePattern.MATCH_ALL); - if (childAssocs.size() != 0) + if (!childAssocs.isEmpty()) { ChildAssociationRef firstChildAssocRef = childAssocs.get(0); result = firstChildAssocRef.getChildRef(); @@ -462,7 +462,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl if (nodeService.exists(dsNodeRef)) { List assocs = this.nodeService.getParentAssocs(dsNodeRef, ASSOC_DISPOSITION_SCHEDULE, RegexQNamePattern.MATCH_ALL); - if (assocs.size() != 0) + if (!assocs.isEmpty()) { if (assocs.size() != 1) { @@ -522,7 +522,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl * * @param isRecordLevelDisposition * @param rmContainer - * @param root * @return */ private List getDisposableItemsImpl(boolean isRecordLevelDisposition, NodeRef rmContainer) @@ -586,13 +585,13 @@ public class DispositionServiceImpl extends ServiceBaseImpl // Check whether there is already a disposition schedule object present List assocs = nodeService.getChildAssocs(nodeRef, ASSOC_DISPOSITION_SCHEDULE, RegexQNamePattern.MATCH_ALL); - if (assocs.size() == 0) + if (assocs.isEmpty()) { DispositionSchedule currentDispositionSchdule = getDispositionSchedule(nodeRef); if (currentDispositionSchdule != null) { List items = getDisposableItemsImpl(currentDispositionSchdule.isRecordLevelDisposition(), nodeRef); - if (items.size() != 0) + if (!items.isEmpty()) { throw new AlfrescoRuntimeException("Can not create a retention schedule if there are disposable items already under the control of an other retention schedule"); } @@ -674,7 +673,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl * Updates the given disposition action definition belonging to the given disposition * schedule. * - * @param schedule The DispositionSchedule the action belongs to * @param actionDefinition The DispositionActionDefinition to update * @param actionDefinitionParams Map of parameters to use to update the action definition * @return The updated DispositionActionDefinition @@ -706,7 +704,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl private DispositionAction initialiseDispositionAction(NodeRef nodeRef, DispositionActionDefinition dispositionActionDefinition, boolean allowContextFromAsOf) { List childAssocs = nodeService.getChildAssocs(nodeRef, ASSOC_NEXT_DISPOSITION_ACTION, ASSOC_NEXT_DISPOSITION_ACTION, 1, true); - if (childAssocs != null && childAssocs.size() > 0) + if (childAssocs != null && !childAssocs.isEmpty()) { return new DispositionActionImpl(serviceRegistry, childAssocs.get(0).getChildRef()); } @@ -871,7 +869,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl { NodeRef result = null; List assocs = nodeService.getChildAssocs(nodeRef, ASSOC_NEXT_DISPOSITION_ACTION, ASSOC_NEXT_DISPOSITION_ACTION, 1, true); - if (assocs.size() != 0) + if (!assocs.isEmpty()) { result = assocs.get(0).getChildRef(); } @@ -964,7 +962,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl if (nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE)) { List assocs = nodeService.getChildAssocs(nodeRef, ASSOC_NEXT_DISPOSITION_ACTION, ASSOC_NEXT_DISPOSITION_ACTION); - if (assocs.size() > 0) + if (!assocs.isEmpty()) { currentDispositionAction = assocs.get(0).getChildRef(); } @@ -1092,7 +1090,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl { DispositionSchedule ds = new DispositionScheduleImpl(serviceRegistry, nodeService, dispositionSchedule); List assocs = nodeService.getChildAssocs(dispositionSchedule); - if (assocs != null && assocs.size() > 0) + if (assocs != null && !assocs.isEmpty()) { for (ChildAssociationRef assoc : assocs) { diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java index 802683146e..3412ff80e9 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/impl/FilePlanComponentsApiUtils.java @@ -927,7 +927,7 @@ public class FilePlanComponentsApiUtils } String pathStr = null; - if (pathElements.size() > 0) + if (!pathElements.isEmpty()) { StringBuilder sb = new StringBuilder(120); for (PathInfo.ElementInfo e : pathElements)