diff --git a/source/java/org/alfresco/opencmis/CMISConnector.java b/source/java/org/alfresco/opencmis/CMISConnector.java index bd388f55ee..f7eda0461e 100644 --- a/source/java/org/alfresco/opencmis/CMISConnector.java +++ b/source/java/org/alfresco/opencmis/CMISConnector.java @@ -1895,6 +1895,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen { List extensions = new ArrayList(); Set propertyIds = new HashSet(alreadySetProperties); + List propertyExtensionList = new ArrayList(); Set filterSet = splitFilter(filter); Set aspects = nodeService.getAspects(info.getNodeRef()); @@ -1909,7 +1910,6 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen extensions.add(new CmisExtensionElementImpl(ALFRESCO_EXTENSION_NAMESPACE, APPLIED_ASPECTS, null, aspectType .getTypeId())); - List propertyExtensionList = new ArrayList(); for (PropertyDefinitionWrapper propDef : aspectType.getProperties()) { if (propertyIds.contains(propDef.getPropertyId())) @@ -1930,13 +1930,13 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen // mark property as 'added' propertyIds.add(propDef.getPropertyId()); } + } - if (!propertyExtensionList.isEmpty()) - { - CmisExtensionElementImpl propertiesExtension = new CmisExtensionElementImpl( - ALFRESCO_EXTENSION_NAMESPACE, "properties", null, propertyExtensionList); - extensions.addAll(Collections.singletonList(propertiesExtension)); - } + if (!propertyExtensionList.isEmpty()) + { + CmisExtensionElementImpl propertiesExtension = new CmisExtensionElementImpl( + ALFRESCO_EXTENSION_NAMESPACE, "properties", null, propertyExtensionList); + extensions.addAll(Collections.singletonList(propertiesExtension)); } return extensions;