jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1587619 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state: ChangeLog.java SharedItemStateManager.java
Date Tue, 15 Apr 2014 15:39:25 GMT
Author: stefan
Date: Tue Apr 15 15:39:25 2014
New Revision: 1587619

URL: http://svn.apache.org/r1587619
Log:
JCR-3770: refine validateHierarchy check in order to avoid false-positives

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java?rev=1587619&r1=1587618&r2=1587619&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
Tue Apr 15 15:39:25 2014
@@ -175,6 +175,17 @@ public class ChangeLog {
     }
 
     /**
+     * Return a flag indicating whether a given item state is marked as
+     * added in this log.
+     *
+     * @return <code>true</code> if item state is marked as added in this
+     *         log; <code>false</code> otherwise
+     */
+    public boolean isAdded(ItemId id) {
+        return addedStates.containsKey(id);
+    }
+
+    /**
      * Returns a flag indicating whether a given item state is marked as
      * modified in this log.
      *

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?rev=1587619&r1=1587618&r2=1587619&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
Tue Apr 15 15:39:25 2014
@@ -1346,7 +1346,7 @@ public class SharedItemStateManager
                 NodeId oldParentId = overlayedState.getParentId();
 
                 // The parent should not be deleted
-                if (parentId != null && changeLog.deleted(parentId)) {
+                if (parentId != null && changeLog.deleted(parentId) && !changeLog.isAdded(parentId))
{
                     String message = "Parent of node with id " + id + " has been deleted";
                     log.error(message);
                     throw new ItemStateException(message);



Mime
View raw message