chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1516870 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
Date Fri, 23 Aug 2013 14:45:26 GMT
Author: jens
Date: Fri Aug 23 14:45:25 2013
New Revision: 1516870

URL: http://svn.apache.org/r1516870
Log:
InMemory: remove calling clone() method

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java?rev=1516870&r1=1516869&r2=1516870&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/StoreManagerImpl.java
Fri Aug 23 14:45:25 2013
@@ -33,6 +33,7 @@ import java.util.Set;
 import org.apache.chemistry.opencmis.commons.data.ObjectList;
 import org.apache.chemistry.opencmis.commons.data.PermissionMapping;
 import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.definitions.MutableTypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.PermissionDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
@@ -259,11 +260,8 @@ public class StoreManagerImpl implements
             result = new ArrayList<TypeDefinitionContainer>(rootTypes.size());
             // copy list and omit properties
             for (TypeDefinitionContainer c : rootTypes) {
-                AbstractTypeDefinition td = ((AbstractTypeDefinition) c.getTypeDefinition()).clone();
+                MutableTypeDefinition td = typeFactory.copy(c.getTypeDefinition(), includePropertyDefinitions);
                 TypeDefinitionContainerImpl tdc = new TypeDefinitionContainerImpl(td);
-                td.setPropertyDefinitions(null);
-//                MutableTypeDefinition td = typeFactory.copy(c.getTypeDefinition(), includePropertyDefinitions);
-//                TypeDefinitionContainerImpl tdc = new TypeDefinitionContainerImpl(td);
                 tdc.setChildren(c.getChildren());
                 result.add(tdc);
             }
@@ -530,12 +528,8 @@ public class StoreManagerImpl implements
     public static TypeDefinitionContainer cloneTypeList(int depth, boolean includePropertyDefinitions,
             TypeDefinitionContainer tdc, TypeDefinitionContainer parent) {
 
-//        final TypeDefinitionFactory typeFactory = TypeDefinitionFactory.newInstance();
-//        MutableTypeDefinition tdClone = typeFactory.copy(tdc.getTypeDefinition(), includePropertyDefinitions);
-        AbstractTypeDefinition tdClone = ((AbstractTypeDefinition) tdc.getTypeDefinition()).clone();
-        if (!includePropertyDefinitions) {
-            tdClone.setPropertyDefinitions(null);
-        }
+        final TypeDefinitionFactory typeFactory = TypeDefinitionFactory.newInstance();
+        MutableTypeDefinition tdClone = typeFactory.copy(tdc.getTypeDefinition(), includePropertyDefinitions);
 
         TypeDefinitionContainerImpl tdcClone = new TypeDefinitionContainerImpl(tdClone);
         if (null != parent) {



Mime
View raw message