On 1.9.16 10:04 , Robert Munteanu wrote:

        NodeState base =
ModifiedNodeState.squeeze(builder.getNodeState());
        NodeStore store = new MemoryNodeStore(base);
        NodeTypeRegistry.registerBuiltIn(RootFactory.createSystemRoot(
                store, new EditorHook(new CompositeEditorProvider(
                new NamespaceEditorProvider(),
                new TypeEditorProvider())), null, null, null, null));

Since the NodeStore is based on a NodeBuilder's current state and that
NodeBuilder is not a MemoryNodeBuilder the check that you mentioned is
triggered.

The question is - is it correct to use a MemoryNodeStore in this way
here?

From that part of the code quoted I would say yes. But there seems to be a deeper issue hidden below somewhere. Is this something you can isolate into a test case?

Michael


Robert


Michael


On 1.9.16 9:36 , Robert Munteanu wrote:

Hi,

I'm working on implementing a custom node store which multiplexes
other
node stores.

Adding it as a fixture in oak-it results in a test failure in

  ReadWriteNamespaceRegistryTest.testMappings [1]

The reason is
that
org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent
class wraps the passed nodeStore into a MemoryNodeStore, and that
memory node store later on receives a builder which is not
MemoryNodeBuilder [2] → IllegalArgumentException.

I'm not familiar enough with that class to propose a fix, but
effectively it forces all builders to be MemoryNodeBuilders, which
is
too restrictive IMO.

Is this a bug to file or something that I need to live with when
implementing a new NodeStore?

Thanks,

Robert


[1]: https://github.com/apache/jackrabbit-oak/blob/64f48874ac4aab6e
0ffb
085e07642ffa44d8c7ca/oak-
it/src/test/java/org/apache/jackrabbit/oak/plugins/name/ReadWriteNa
mesp
aceRegistryTest.java#L46
[2]: https://github.com/apache/jackrabbit-oak/blob/64f48874ac4aab6e
0ffb
085e07642ffa44d8c7ca/oak-
core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/write
/Ini
tialContent.java#L119


Reply via email to