jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r786329 - /jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java
Date Thu, 18 Jun 2009 22:59:54 GMT
Author: tripod
Date: Thu Jun 18 22:59:54 2009
New Revision: 786329

URL: http://svn.apache.org/viewvc?rev=786329&view=rev
Log:
fix bug with names

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java?rev=786329&r1=786328&r2=786329&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java
Thu Jun 18 22:59:54 2009
@@ -170,7 +170,7 @@
         this(resolver.getQName(def.getName()),
                 getNames(def.getDeclaredSupertypeNames(), resolver), null, def.isMixin(),
                 def.isAbstract(), def.isQueryable(), def.hasOrderableChildNodes(),
-                resolver.getQName(def.getPrimaryItemName()),
+                def.getPrimaryItemName() == null ? null : resolver.getQName(def.getPrimaryItemName()),
                 createQPropertyDefinitions(def.getDeclaredPropertyDefinitions(), resolver,
qValueFactory),
                 createQNodeDefinitions(def.getDeclaredChildNodeDefinitions(), resolver));
     }
@@ -358,7 +358,9 @@
         QPropertyDefinition[] declaredPropDefs = new QPropertyDefinition[pds.length];
         for (int i = 0; i < pds.length; i++) {
             PropertyDefinition propDef = pds[i];
-            Name name = resolver.getQName(propDef.getName());
+            Name name = propDef.getName().equals(QItemDefinitionImpl.ANY_NAME.getLocalName())
+                    ? QItemDefinitionImpl.ANY_NAME
+                    : resolver.getQName(propDef.getName());
             Name declName = resolver.getQName(propDef.getDeclaringNodeType().getName());
             QValue[] defVls = ValueFormat.getQValues(propDef.getDefaultValues(), resolver,
qValueFactory);
             String[] jcrConstraints = propDef.getValueConstraints();
@@ -387,9 +389,13 @@
         QNodeDefinition[] declaredNodeDefs = new QNodeDefinition[nds.length];
         for (int i = 0; i < nds.length; i++) {
             NodeDefinition nodeDef = nds[i];
-            Name name = resolver.getQName(nodeDef.getName());
+            Name name = nodeDef.getName().equals(QItemDefinitionImpl.ANY_NAME.getLocalName())
+                    ? QItemDefinitionImpl.ANY_NAME
+                    : resolver.getQName(nodeDef.getName());
             Name declName = resolver.getQName(nodeDef.getDeclaringNodeType().getName());
-            Name defaultPrimaryType = resolver.getQName(nodeDef.getDefaultPrimaryTypeName());
+            Name defaultPrimaryType = nodeDef.getDefaultPrimaryTypeName() == null
+                    ? null
+                    : resolver.getQName(nodeDef.getDefaultPrimaryTypeName());
             Name[] requiredPrimaryTypes = getNames(nodeDef.getRequiredPrimaryTypeNames(),
resolver);
 
             declaredNodeDefs[i] = new QNodeDefinitionImpl(



Mime
View raw message