Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-4847

Support any types of node builders in the initializers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5.11, 1.6.0
    • core
    • None

    Description

      In case that one of the following classes:

      • org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent
      • org.apache.jackrabbit.oak.security.privilege.PrivilegeInitializer
      • org.apache.jackrabbit.oak.security.user.UserInitializer

      tries to initialize a NodeBuilder which is not derived from the MemoryNodeState or ModifiedNodeState, it breaks with an exception:

      java.lang.IllegalArgumentException
      	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:7
      7)
      	at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.merge(MemoryNo
      deStore.java:126)
      	at
      org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:249)
      (...)
      	at
      org.apache.jackrabbit.oak.plugins.nodetype.write.NodeTypeRegistry.regis
      terBuiltIn(NodeTypeRegistry.java:86)
      	at
      org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.initial
      ize(InitialContent.java:120)
      

      It can be fixed wrapping the node state passed to the MemoryNodeStore constructor with a MemoryNodeState.

      Attachments

        Issue Links

          Activity

            People

              tomek.rekawek Tomek Rękawek
              tomek.rekawek Tomek Rękawek
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: