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

[PATCH] Jackrabbit disallows some nodetype changes which are in fact safe.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • jackrabbit-core, nodetype
    • None

    Description

      When reregistering nodetypes using org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.reregisterNodeType(), Jackrabbit uses the NodeTypeDefDiff class to compare the old nodetype definitions with the new definitions to determine if the nodetype changes can be permitted. Changing a node property from not multiple to multiple is safe and should be allowed, but there is a bug in NodeTypeDefDiff.java which prevents this change from being permitted.

      The NodeTypeDefDiff..buildPropDefDiffs() tries to compare the old and new version of each property definition. Around line 260, it tries to pull the new definition of a property out of a map using the PropDefId object from the old definition as a key. The problem is that this key is not only built up from the name of the property, but also from its attributes (e.g. multiple, type, constraints etc). This means that if the property definition changes, then the new property definition will have a different PropDefId than the old version and hence will not be found in the map. The code then treats the missing property definition as being a major change that can't be permitted.

      see patch.

      Attachments

        1. NodeTypeDefDiff_JCR-853.diff
          2 kB
          Simon Edwards

        Activity

          People

            stefan@jira Stefan Guggisberg
            sedwards Simon Edwards
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: