jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Pfister (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (JCR-1773) shareable nodes: wrong path returned, causes remove() to delete wrong node
Date Wed, 01 Jul 2009 11:42:48 GMT

     [ https://issues.apache.org/jira/browse/JCR-1773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Dominique Pfister resolved JCR-1773.

    Resolution: Fixed
      Assignee: Dominique Pfister

Thank you, Lars, for providing a patch. I just had to add the edge case of resolving a parent
node or path, when the target itself is the root node.

Removed org.apache.jackrabbit.test.api.ShareableNodeTest#testSharedNodePath from the known.issues
element in jackrabbit-core/pom.xml since the test now passes.

Fixed in revision 790127.

> shareable nodes: wrong path returned, causes remove() to delete wrong node
> --------------------------------------------------------------------------
>                 Key: JCR-1773
>                 URL: https://issues.apache.org/jira/browse/JCR-1773
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Julian Reschke
>            Assignee: Dominique Pfister
>         Attachments: ItemManager.java.patch, NodeImpl.java.patch
> It seems that for shareable nodes it can happen that getPath() returns the wrong path
(one of another node in the shared set):
> /**
> * Verify that shared nodes return correct paths.
> */
> public void testPath() throws Exception {
>    Node a1 = testRootNode.addNode("a1");
>    Node a2 = a1.addNode("a2");
>    Node b1 = a1.addNode("b1");
>    b1.addMixin("mix:shareable");
>    testRootNode.save();
>    //now we have a shareable node N with path a1/b1
>    Session session = testRootNode.getSession();
>    Workspace workspace = session.getWorkspace();
>    String path = a2.getPath() + "/b2";
>    workspace.clone(workspace.getName(), b1.getPath(), path, false);
>    //now we have another shareable node N' in the same shared set as N with path a1/a2/b2
>    //using the path a1/a2/b2, we should get the node N' here
>    Item item = session.getItem(path);
>    String p = item.getPath();
>    assertFalse("unexpectedly got the path from another node from the same shared set
", p.equals(b1.getPath()));
> } 
> Note that when this happens, a subsequent remove() deletes the wrong node.
> (Thanks Manfred for spotting this one).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message