jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r587011 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: hierarchy/NodeEntryImpl.java state/NodeState.java
Date Mon, 22 Oct 2007 06:51:45 GMT
Author: angela
Date: Sun Oct 21 23:51:44 2007
New Revision: 587011

URL: http://svn.apache.org/viewvc?rev=587011&view=rev
Log:
JCR-1099 jcr2spi NodeEntryImpl.getPath() blows stack due to getIndex() calling itself

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/state/NodeState.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?rev=587011&r1=587010&r2=587011&view=diff
==============================================================================
--- 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
Sun Oct 21 23:51:44 2007
@@ -352,7 +352,7 @@
 
         NodeState state = (NodeState) internalGetItemState();
         try {
-            if (state == null || state.getDefinition().allowsSameNameSiblings()) {
+            if (state == null || !state.hasDefinition() || state.getDefinition().allowsSameNameSiblings())
{
                 return parent.getChildIndex(this);
             } else {
                 return Path.INDEX_DEFAULT;

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java?rev=587011&r1=587010&r2=587011&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
Sun Oct 21 23:51:44 2007
@@ -375,6 +375,16 @@
     }
 
     /**
+     * Returns true if the definition of this state has already been
+     * calculated. False otherwise.
+     *
+     * @return true if definition has already been calculated.
+     */
+    public boolean hasDefinition() throws RepositoryException {
+        return definition != null;
+    }
+
+    /**
      * Returns the {@link QNodeDefinition definition} defined for this
      * node state. Note, that the definition has been set upon creation or
      * upon move.



Mime
View raw message