jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r225151 - in /incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype: EffectiveNodeType.java NodeTypeRegistry.java
Date Mon, 25 Jul 2005 16:40:42 GMT
Author: stefan
Date: Mon Jul 25 09:40:38 2005
New Revision: 225151

URL: http://svn.apache.org/viewcvs?rev=225151&view=rev
Log:
test for ambiguous residual child node definition is too restrictive

Modified:
    incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java
    incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java

Modified: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java?rev=225151&r1=225150&r2=225151&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java
(original)
+++ incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java
Mon Jul 25 09:40:38 2005
@@ -29,6 +29,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.TreeSet;
+import java.util.Arrays;
 
 /**
  * An <code>EffectiveNodeType</code> represents one or more
@@ -1031,14 +1032,22 @@
                         }
                     } else {
                         // child node definition
-                        // conflict
-                        String msg = "A child node definition in node type '"
-                                + def.getDeclaringNodeType()
-                                + "' conflicts with node type '"
-                                + existing.getDeclaringNodeType()
-                                + "': ambiguous residual child node definition";
-                        log.debug(msg);
-                        throw new NodeTypeConflictException(msg);
+                        NodeDef nd = (NodeDef) def;
+                        NodeDef end = (NodeDef) existing;
+                        // compare required & default primary types
+                        if (Arrays.equals(nd.getRequiredPrimaryTypes(), end.getRequiredPrimaryTypes())
+                                && (nd.getDefaultPrimaryType() == null
+                                ? end.getDefaultPrimaryType() == null
+                                : nd.getDefaultPrimaryType().equals(end.getDefaultPrimaryType())))
{
+                            // conflict
+                            String msg = "A child node definition in node type '"
+                                    + def.getDeclaringNodeType()
+                                    + "' conflicts with node type '"
+                                    + existing.getDeclaringNodeType()
+                                    + "': ambiguous residual child node definition";
+                            log.debug(msg);
+                            throw new NodeTypeConflictException(msg);
+                        }
                     }
                 }
             }

Modified: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?rev=225151&r1=225150&r2=225151&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
(original)
+++ incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Mon Jul 25 09:40:38 2005
@@ -1716,7 +1716,7 @@
          * be "[a, b, c]").
          *
          * @return string representation of this sorted set
-         * @see AbstractCollection#toString
+         * @see java.util.AbstractCollection#toString
          */
         String getKey() {
             return set.toString();



Mime
View raw message