Author: tripod Date: Thu Mar 13 18:57:36 2008 New Revision: 636949 URL: http://svn.apache.org/viewvc?rev=636949&view=rev Log: JCR-1471 Error when registering nodetype with same propdef as supertype (reverting changes) Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java?rev=636949&r1=636948&r2=636949&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java (original) +++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java Thu Mar 13 18:57:36 2008 @@ -662,7 +662,7 @@ String msg = "The item definition for '" + name + "' in node type '" + qDef.getDeclaringNodeType() - + "' conflicts with node type '" + + "' conflicts with the one of node type '" + qItemDef.getDeclaringNodeType() + "': name collision with auto-create definition"; log.debug(msg); @@ -675,15 +675,17 @@ QPropertyDefinition pd = (QPropertyDefinition) qDef; QPropertyDefinition epd = (QPropertyDefinition) qItemDef; // compare type & multiValued flag - if (pd.getRequiredType() != epd.getRequiredType() - || pd.isMultiple() != epd.isMultiple()) { + if (pd.getRequiredType() == epd.getRequiredType() + && pd.isMultiple() == epd.isMultiple()) { // conflict String msg = "The property definition for '" + name + "' in node type '" + qDef.getDeclaringNodeType() - + "' conflicts with node type '" + + "' conflicts with the one of node type '" + qItemDef.getDeclaringNodeType() - + "': ambiguous property definition"; + + "': ambiguous property definition. " + + "they must differ in required type " + + "or cardinality."; log.debug(msg); throw new NodeTypeConflictException(msg); } @@ -693,9 +695,9 @@ String msg = "The child node definition for '" + name + "' in node type '" + qDef.getDeclaringNodeType() - + "' conflicts with node type '" + + "' conflicts with the one of node type '" + qItemDef.getDeclaringNodeType() - + "': ambiguous child node definition"; + + "': ambiguous child node definition. name must differ."; log.debug(msg); throw new NodeTypeConflictException(msg); }