On Thu, 2016-09-01 at 11:14 +0200, Michael Dürig wrote:
> 
> On 1.9.16 10:04 , Robert Munteanu wrote:
> > 
> > 
> >         NodeState base =
> > ModifiedNodeState.squeeze(builder.getNodeState());
> >         NodeStore store = new MemoryNodeStore(base);
> >         NodeTypeRegistry.registerBuiltIn(RootFactory.createSystemRo
> > ot(
> >                 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?

I have a failing test in my fork at 

  https://github.com/rombert/jackrabbit-oak/

If I run ReadWriteNamespaceRegistryTest from Eclipse it picks up all
fixtures - including the Multiplexing one I added - and fails with that
one.

Getting this isolated would be hard since it requires a full NodeStore
implementation whose NodeState and NodeBuilder implementations don't
extend the memory-based ones.

Thanks,

Robert

> 
> 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/64f48874ac4a
> > > > ab6e
> > > > 0ffb
> > > > 085e07642ffa44d8c7ca/oak-
> > > > it/src/test/java/org/apache/jackrabbit/oak/plugins/name/ReadWri
> > > > teNa
> > > > mesp
> > > > aceRegistryTest.java#L46
> > > > [2]: https://github.com/apache/jackrabbit-oak/blob/64f48874ac4a
> > > > ab6e
> > > > 0ffb
> > > > 085e07642ffa44d8c7ca/oak-
> > > > core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/w
> > > > rite
> > > > /Ini
> > > > tialContent.java#L119
> > > > 
> > 

Reply via email to