Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1050

NPE in NodeTypeManager when validating a recursive node definition

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.5.0.Final
    • 2.3.0.Final
    • JCR
    • None
    • Hide
      • Create a node definition with a child node of the same type (using CND or API)
      • Register it with the NodeTypeManager

      Exemple node definitions :

      • CND

      <mx = urn:myproject>
      [mx:type]
      + * (mx:type) multiple

      • API
        NodeTypeManager manager;
        // [...]
        final NodeTypeTemplate nodeType = manager.createNodeTypeTemplate();
        nodeType.setName("mx:type");
        final NodeDefinitionTemplate subTypes = manager.createNodeDefinitionTemplate();
        subTypes.setRequiredPrimaryTypeNames(new String[] {"mx:type"}

        );
        nodeType.getNodeDefinitionTemplates().add(subTypes);

      Show
      Create a node definition with a child node of the same type (using CND or API) Register it with the NodeTypeManager Exemple node definitions : CND <mx = urn:myproject> [mx:type] + * (mx:type) multiple API NodeTypeManager manager; // [...] final NodeTypeTemplate nodeType = manager.createNodeTypeTemplate(); nodeType.setName("mx:type"); final NodeDefinitionTemplate subTypes = manager.createNodeDefinitionTemplate(); subTypes.setRequiredPrimaryTypeNames(new String[] {"mx:type"} ); nodeType.getNodeDefinitionTemplates().add(subTypes);

    Description

      org.modeshape.jcr.RepositoryNodeTypeManager.validate(JcrNodeDefinition, List<Name>, List<JcrNodeType>) throws a NullPointerException at line 2084 (npt is null) when validating a node type definition that as a child node of the same type. This NPE seems to be caused by the absence of the current node definition in the list of pending types when checking the type's child nodes.

      Attachments

        Activity

          People

            bcarothers_jira Brian Carothers (Inactive)
            edouard.hue Édouard Hue (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: