[exo-jcr-commits] exo-jcr SVN: r5162 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Nov 4 06:58:28 EDT 2011


Author: zavizionov
Date: 2011-11-04 06:58:28 -0400 (Fri, 04 Nov 2011)
New Revision: 5162

Modified:
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
Log:
EXOJCR-1568 Can't remove mixin from node and add mixin again.

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java	2011-11-04 10:54:33 UTC (rev 5161)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java	2011-11-04 10:58:28 UTC (rev 5162)
@@ -29,6 +29,7 @@
 import org.exoplatform.services.jcr.core.nodetype.NodeTypeData;
 import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
 import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData;
+import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionDatas;
 import org.exoplatform.services.jcr.dataflow.ItemState;
 import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
 import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl;
@@ -1929,9 +1930,11 @@
 
       for (PropertyDefinitionData pd : ntmanager.getAllPropertyDefinitions(removedName))
       {
-         // to skip remove propertyDefinition with existed another nodeType property definition  
-         if (ntmanager.getPropertyDefinitions(pd.getName(), nodeData().getPrimaryTypeName(), newMixin
-            .toArray(new InternalQName[]{})) == null)
+         // to skip remove propertyDefinition with existed another nodeType property definition
+         PropertyDefinitionDatas propertyDefinitions =
+            ntmanager.getPropertyDefinitions(pd.getName(), nodeData().getPrimaryTypeName(), newMixin
+               .toArray(new InternalQName[]{}));
+         if (propertyDefinitions == null || propertyDefinitions.getDefinition(pd.isMultiple()).isResidualSet())
          {
             ItemData p = dataManager.getItemData(nodeData(), new QPathEntry(pd.getName(), 1), ItemType.PROPERTY, false);
             if (p != null && !p.isNode())



More information about the exo-jcr-commits mailing list