Hi,
I think the core of the problem is that the memory node store doesn't
always behave properly when initialised with something else than a
MemoryNodeState. Consider:
NodeState base = new AlienNodeState();
NodeStore store = new MemoryNodeStore(base);
NodeBuilder builder = store.getRoot().builder();
store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
The merge call will throw an IAE if base.builder() does return a builder
instance that doesn't inherit from MemoryNodeBuilder.
To this respect I think your fix is basically correct, it should just be
applied deeper down. Instead of wrapping the base states before passing
them to the MemoryNodeStore constructor, I think that constructor should
do the wrapping in case the passed base state is of a different type.
Michael
On 22.9.16 2:49 , Tomek Rekawek wrote:
Hi,
I’ve looked into this issue. I think it’s caused by the fact that the squeeze()
method sometimes doesn’t wrap the passed node state with MemoryNodeStates, but
return it as-is. I tried to wrap the state unconditionally in the initializers
and it fixed the issue.
Michael, Robert - do you think [1] is an acceptable solution? If so, I’ll
create a proper JIRA and merge the code.
Regards,
Tomek
[1] https://github.com/trekawek/jackrabbit-oak/commit/cf3d73