jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r563794 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: hierarchy/NodeEntryImpl.java nodetype/NodeTypeRegistryImpl.java
Date Wed, 08 Aug 2007 09:06:09 GMT
Author: angela
Date: Wed Aug  8 02:06:01 2007
New Revision: 563794

URL: http://svn.apache.org/viewvc?view=rev&rev=563794
Log:
JCR-1040: JCR2SPI remove node operation missing in submitted SPI batch

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java?view=diff&rev=563794&r1=563793&r2=563794
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
Wed Aug  8 02:06:01 2007
@@ -541,7 +541,9 @@
                     cne = ne;
                 }
             }
-        } else if (loadIfNotFound && !containsAtticChild(entries, nodeName, index))
{
+        } else if (loadIfNotFound
+                && !containsAtticChild(entries, nodeName, index) 
+                && Status.NEW != getStatus()) {
             NodeId cId = factory.getIdFactory().createNodeId(getId(), Path.create(nodeName,
index));
             cne = loadNodeEntry(cId);
         }
@@ -650,7 +652,7 @@
      */
     public PropertyEntry getPropertyEntry(QName propName, boolean loadIfNotFound) throws
RepositoryException {
         PropertyEntry entry = properties.get(propName);
-        if (entry == null && loadIfNotFound) {
+        if (entry == null && loadIfNotFound && Status.NEW != getStatus())
{
             PropertyId propId = factory.getIdFactory().createPropertyId(getId(), propName);
             entry = loadPropertyEntry(propId);
         } else if (!EntryValidation.isValidPropertyEntry(entry)) {

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java?view=diff&rev=563794&r1=563793&r2=563794
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
Wed Aug  8 02:06:01 2007
@@ -21,6 +21,7 @@
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.Status;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
+import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
@@ -318,15 +319,18 @@
                 QName primaryType = nodeState.getNodeTypeName();
                 allNtNames = new QName[] { primaryType }; // default
                 try {
-                    PropertyState mixins = nodeState.getPropertyState(QName.JCR_MIXINTYPES);
-                    QValue[] values = mixins.getValues();
-                    allNtNames = new QName[values.length + 1];
-                    for (int i = 0; i < values.length; i++) {
-                        allNtNames[i] = values[i].getQName();
-                    }
-                    allNtNames[values.length] = primaryType;
+                    PropertyEntry pe = nodeState.getNodeEntry().getPropertyEntry(QName.JCR_MIXINTYPES,
true);
+                    if (pe != null) {
+                        PropertyState mixins = pe.getPropertyState();
+                        QValue[] values = mixins.getValues();
+                        allNtNames = new QName[values.length + 1];
+                        for (int i = 0; i < values.length; i++) {
+                            allNtNames[i] = values[i].getQName();
+                        }
+                        allNtNames[values.length] = primaryType;
+                    } // else: no jcr:mixinTypes property exists -> ignore
                 } catch (RepositoryException e) {
-                    // ignore: apparently no jcr:mixinTypes property exists.
+                    // unexpected error: ignore
                 }
             }
             return getEffectiveNodeType(allNtNames);



Mime
View raw message