Index: EffectiveNodeType.java =================================================================== --- EffectiveNodeType.java (revision 368126) +++ EffectiveNodeType.java (working copy) @@ -28,6 +28,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.TreeSet; import java.util.Arrays; @@ -97,6 +98,25 @@ */ public static EffectiveNodeType create(NodeTypeRegistry ntReg, NodeTypeDef ntd) throws NodeTypeConflictException, NoSuchNodeTypeException { + return create (ntReg, ntd,null,null); + } + + /** + * Factory method: creates an effective node type + * representation of a node type definition. Whereas all referenced + * node types must exist (i.e. must be registered), the definition itself + * is not required to be registered. + * + * @param ntReg + * @param ntd + * @param anEntCache + * @param aRegisterednTDefCache + * @return + * @throws NodeTypeConflictException + * @throws NoSuchNodeTypeException + */ + public static EffectiveNodeType create(NodeTypeRegistry ntReg, NodeTypeDef ntd, EffectiveNodeTypeCache anEntCache, Map aRegisteredNTDefCache) + throws NodeTypeConflictException, NoSuchNodeTypeException { // create empty effective node type instance EffectiveNodeType ent = new EffectiveNodeType(ntReg); QName ntName = ntd.getName(); @@ -210,7 +230,11 @@ // resolve supertypes recursively QName[] supertypes = ntd.getSupertypes(); if (supertypes != null && supertypes.length > 0) { - ent.internalMerge(ntReg.getEffectiveNodeType(supertypes), true); + if (anEntCache==null || aRegisteredNTDefCache==null){ + ent.internalMerge(ntReg.getEffectiveNodeType(supertypes), true); + } else { + ent.internalMerge(ntReg.getEffectiveNodeType(supertypes,anEntCache,aRegisteredNTDefCache), true); + } } // we're done