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

NPE in NodeTypeManager when validating a recursive node definition

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.3.0.Final
    • Fix Version/s: 2.5.0.Final
    • Component/s: JCR
    • Labels:
      None
    • Environment:

      ModeShape 2.3 with JpaConnecter on Tomcat 6

    • Steps to Reproduce:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bcarothers Brian Carothers
                Reporter:
                edouardh Edouard Hue
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: