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

Registering NodeType with defaultvalues fails with IndexOutOfBounds

    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

        1. unnamed.patch
          1.0 kB
          christian

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: