Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-2139

Registering NodeType with defaultvalues fails with IndexOutOfBounds

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-alpha1
    • 1.6, 2.0-alpha3
    • jackrabbit-core
    • None

    Description

      When trying to register more than one nodetpye with default values I get the following exception:

      Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
      at org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl.toNodeTypeDef(NodeTypeManagerImpl.java:790)
      at org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl.registerNodeTypes(NodeTypeManagerImpl.java:560)

      I assume there is an index missmatch in the implementation

      Value[] values = pdefs[i].getDefaultValues();
      if (values != null) {
      InternalValue[] qvalues = new InternalValue[values.length];
      for (int j = 0; j < values.length; j++) {
      try

      { --> qvalues[j] = InternalValue.create(values[i], session); }

      catch (ValueFormatException e)

      { throw new InvalidNodeTypeDefinitionException( "Invalid default value format", e); }

      }
      qpdef.setDefaultValues(qvalues);
      }

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            chrisk christian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment