chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1718574 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java
Date Tue, 08 Dec 2015 12:00:58 GMT
Author: fmui
Date: Tue Dec  8 12:00:58 2015
New Revision: 1718574

URL: http://svn.apache.org/viewvc?rev=1718574&view=rev
Log:
Server: fixed the TypeDefinitionFactory fix

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java?rev=1718574&r1=1718573&r2=1718574&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java
Tue Dec  8 12:00:58 2015
@@ -1316,16 +1316,17 @@ public final class TypeDefinitionFactory
         Map<String, String> attrs = (element.getAttributes() != null ? new HashMap<String,
String>(
                 element.getAttributes()) : null);
 
-        if (isNotEmpty(element.getChildren())) {
-            return new CmisExtensionElementImpl(element.getNamespace(), element.getName(),
attrs, element.getValue());
-        } else {
-            List<CmisExtensionElement> children = new ArrayList<CmisExtensionElement>();
+        List<CmisExtensionElement> children = element.getChildren();
+        if (isNotEmpty(children)) {
+            List<CmisExtensionElement> copyChildren = new ArrayList<CmisExtensionElement>(children.size());
 
-            for (CmisExtensionElement child : element.getChildren()) {
-                children.add(copy(child));
+            for (CmisExtensionElement child : children) {
+                copyChildren.add(copy(child));
             }
 
-            return new CmisExtensionElementImpl(element.getNamespace(), element.getName(),
attrs, children);
+            return new CmisExtensionElementImpl(element.getNamespace(), element.getName(),
attrs, copyChildren);
+        } else {
+            return new CmisExtensionElementImpl(element.getNamespace(), element.getName(),
attrs, element.getValue());
         }
     }
 



Mime
View raw message