From af2b45f9ce205e7fe96c575c2cbdd31b5670c5df Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Tue, 5 Nov 2019 16:43:57 +0200 Subject: [PATCH] update java docs & fix sonar "Mutable members should not be stored or returned directly" from PropertyModificationAllowedCheck class --- .../util/PropertyModificationAllowedCheck.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/PropertyModificationAllowedCheck.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/PropertyModificationAllowedCheck.java index 68de8e85d8..88544fbbd5 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/PropertyModificationAllowedCheck.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/util/PropertyModificationAllowedCheck.java @@ -26,6 +26,8 @@ */ package org.alfresco.module.org_alfresco_module_rm.util; +import static java.util.Collections.unmodifiableList; + import java.io.Serializable; import java.util.HashSet; import java.util.List; @@ -59,7 +61,7 @@ public class PropertyModificationAllowedCheck */ private List getEditableURIs() { - return editableURIs; + return unmodifiableList(editableURIs); } /** @@ -69,7 +71,7 @@ public class PropertyModificationAllowedCheck */ public void setEditableURIs(List editableURIs) { - this.editableURIs = editableURIs; + this.editableURIs = unmodifiableList(editableURIs); } /** @@ -79,7 +81,8 @@ public class PropertyModificationAllowedCheck */ public void setWhiteList(List whiteList) { - this.whiteList = whiteList; + this.whiteList = unmodifiableList(whiteList); + } /** @@ -87,7 +90,8 @@ public class PropertyModificationAllowedCheck * * @param before current node properties * @param after updated properties for the node - * @return true - if all modified property keys are in the whitelist + * @return true - if all modified property keys are in the whitelist or + * in the list of model URI's for which the properties can be modified */ public boolean check(Map before, Map after) {