diff --git a/source/java/org/alfresco/rest/api/impl/NodesImpl.java b/source/java/org/alfresco/rest/api/impl/NodesImpl.java index 82bf4ff435..92c391bd5a 100644 --- a/source/java/org/alfresco/rest/api/impl/NodesImpl.java +++ b/source/java/org/alfresco/rest/api/impl/NodesImpl.java @@ -132,6 +132,7 @@ import org.alfresco.service.cmr.version.VersionType; import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; import org.alfresco.util.Pair; +import org.alfresco.util.PropertyCheck; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -203,7 +204,7 @@ public class NodesImpl implements Nodes // ignore types/aspects private Set ignoreQNames; - private ConcurrentHashMap ddCache = new ConcurrentHashMap(); + private ConcurrentHashMap ddCache = new ConcurrentHashMap<>(); private Set nonAttachContentTypes = Collections.emptySet(); // pre-configured whitelist, eg. images & pdf @@ -214,6 +215,12 @@ public class NodesImpl implements Nodes public void init() { + PropertyCheck.mandatory(this, "serviceRegistry", sr); + PropertyCheck.mandatory(this, "behaviourFilter", behaviourFilter); + PropertyCheck.mandatory(this, "repositoryHelper", repositoryHelper); + PropertyCheck.mandatory(this, "quickShareLinks", quickShareLinks); + PropertyCheck.mandatory(this, "poster", poster); + this.namespaceService = sr.getNamespaceService(); this.fileFolderService = sr.getFileFolderService(); this.nodeService = sr.getNodeService(); @@ -1491,7 +1498,7 @@ public class NodesImpl implements Nodes // Checks for the presence of, and creates as necessary, // the folder structure in the provided path elements list. - if (pathElements != null && !pathElements.isEmpty()) + if (!pathElements.isEmpty()) { parentNodeRef = makeFolders(parentNodeRef, pathElements); }