jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r508431 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
Date Fri, 16 Feb 2007 14:55:41 GMT
Author: angela
Date: Fri Feb 16 06:55:40 2007
New Revision: 508431

URL: http://svn.apache.org/viewvc?view=rev&rev=508431
Log:
#0000 - avoid NPE upon Restore.persisted in case of a 
        Workspace.restore.

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java?view=diff&rev=508431&r1=508430&r2=508431
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
Fri Feb 16 06:55:40 2007
@@ -68,16 +68,19 @@
      */
     public void persisted(CacheBehaviour cacheBehaviour) {
         if (cacheBehaviour == CacheBehaviour.INVALIDATE) {
+            NodeEntry entry;
             if (nodeState == null || removeExisting) {
                 // invalidate the complete tree
-                NodeEntry root = nodeState.getNodeEntry();
-                while (root.getParent() != null) {
-                    root = root.getParent();
+                // -> start searching root-entry from any version-entry or
+                //    from the given nodestate
+                entry = (nodeState == null) ? versionStates[0].getNodeEntry() : nodeState.getNodeEntry();
+                while (entry.getParent() != null) {
+                    entry = entry.getParent();
                 }
-                root.invalidate(true);
             } else {
-                nodeState.getHierarchyEntry().invalidate(true);
+                entry = nodeState.getNodeEntry();
             }
+            entry.invalidate(true);
         }
     }
     //----------------------------------------< Access Operation Parameters >---



Mime
View raw message