[ 
https://issues.apache.org/jira/browse/OAK-612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13573730#comment-13573730
 ] 

angela commented on OAK-612:
----------------------------

one solution that IMO should work with limit effort was extending
the Tree interface by something like:

{code}
Tree#setHasOrderableChildren(boolean)
{code}

that could be called for parent nodes that have a primary node type
that returns true on {code}NodeType#hasOrderableChildNodes{code}
upon creation AND upon {code}Node#setPrimaryType{code}.

wdyt? would that work?


                
> Calling addNode on a node that has orderable child nodes violates 
> specification
> -------------------------------------------------------------------------------
>
>                 Key: OAK-612
>                 URL: https://issues.apache.org/jira/browse/OAK-612
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, jcr
>            Reporter: angela
>
> it seems to me that the current behavior of Node.addNode for a node that 
> has orderable child nodes violates the specification (section 23.3):
> {quote}
> 23.3 Adding a New Child Node
> When a child node is added to a node that has orderable child nodes
> it is added to the end of the list.
> {quote}
> however, the following test will fail:
> {code}
> @Test
>     public void testAddNode() throws Exception {
>         new TestContentLoader().loadTestContent(getAdminSession());
>         Session session = getAdminSession();
>         Node test = session.getRootNode().addNode("test", 
> "test:orderableFolder");
>         assertTrue(test.getPrimaryNodeType().hasOrderableChildNodes());
>         Node n1 = test.addNode("a");
>         Node n2 = test.addNode("b");
>         session.save();
>         NodeIterator it = test.getNodes();
>         assertEquals("a", it.nextNode().getName());
>         assertEquals("b", it.nextNode().getName());
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to