jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r408873 - /jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Date Tue, 23 May 2006 11:15:03 GMT
Author: tripod
Date: Tue May 23 04:15:02 2006
New Revision: 408873

URL: http://svn.apache.org/viewvc?rev=408873&view=rev
Log:
JCR-437 Restoring a node which has OPV=Version children fails if they are not versionable

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?rev=408873&r1=408872&r2=408873&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java Tue
May 23 04:15:02 2006
@@ -3804,9 +3804,12 @@
                 // only remove OPV=Copy nodes
                 n.internalRemove(true);
             } else if (n.getDefinition().getOnParentVersion() == OnParentVersionAction.VERSION)
{
-                // only remove, if node to be restored does not contain child
-                UUID vhUUID = new UUID(n.getProperty(QName.JCR_VERSIONHISTORY).getString());
-                if (!freeze.hasFrozenHistory(vhUUID)) {
+                // only remove, if node to be restored does not contain child,
+                // or if restored child is not versionable
+                UUID vhUUID = n.hasProperty(QName.JCR_VERSIONHISTORY)
+                        ? new UUID(n.getProperty(QName.JCR_VERSIONHISTORY).getString())
+                        : null;
+                if (vhUUID == null || !freeze.hasFrozenHistory(vhUUID)) {
                     n.internalRemove(true);
                 }
             }



Mime
View raw message