You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2014/07/21 16:09:40 UTC

svn commit: r1612273 - /sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/AddOrUpdateNodeCommand.java

Author: rombert
Date: Mon Jul 21 14:09:39 2014
New Revision: 1612273

URL: http://svn.apache.org/r1612273
Log:
SLING-3768 - Be more resilient when .content.xml listing and filesystem
disagree on child nodes

Do not attempt to change the primary node type of the root node, as that
is an illegal operation.

Modified:
    sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/AddOrUpdateNodeCommand.java

Modified: sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/AddOrUpdateNodeCommand.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/AddOrUpdateNodeCommand.java?rev=1612273&r1=1612272&r2=1612273&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/AddOrUpdateNodeCommand.java (original)
+++ sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/AddOrUpdateNodeCommand.java Mon Jul 21 14:09:39 2014
@@ -199,7 +199,7 @@ public class AddOrUpdateNodeCommand exte
         }
 
         String primaryType = (String) resource.getProperties().get(JcrConstants.JCR_PRIMARYTYPE);
-        if (!node.getPrimaryNodeType().getName().equals(primaryType)) {
+        if (!node.getPrimaryNodeType().getName().equals(primaryType) && node.getDepth() != 0) {
             node.setPrimaryType(primaryType);
             primaryTypeHasChanged = true;
             getLogger().trace("Set new primary type {0} for node at {1}", primaryType, node.getPath());