jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulrich <For...@gombers.de>
Subject Re: Reference to same-name sibling lost when retrieving back node from intermediate storing class
Date Thu, 11 Jul 2013 13:25:39 GMT
When changing ComparableNode-Constructor to:
         public ComparableNode(Node node) throws Exception {
                 this.node=node;
                 this.session=node.getSession();
                 LOGGER.info("Nodename2="+getNode().getPath());
                 buildEffectiveACL();
         }

I see these messages:
Nodename1=/content/sibling[2]/mynode
Nodename3=/content/sibling[2]/mynode
Nodename2=/content/sibling[2]/mynode
Nodename3=/content/sibling/mynode
Nodename4=/content/sibling/mynode


> Ulrich <Forums@gombers.de> hat am 11. Juli 2013 um 15:20 geschrieben:
>
>
> While researching nodes I build for each of these nodes a new object with some
> methods to be tested.
> So I have a class "ComparableNode":
>
>         private Session session;
>         private final Node node;
>
>         public ComparableNode(Node node) throws Exception {
>                 this.node=node;
>                 this.session=node.getSession();
>                 LOGGER.info("Nodename2="+node.getPath());
>                 buildEffectiveACL();
>         }
>
>         public Node getNode() throws RepositoryException {
>                 LOGGER.info("Nodename3="+node.getPath());
>                 return this.node;
>         }
>
> The class is instantiated by:
>         LOGGER.info("Nodename1="+node.getPath());
>         ComparableNode cmpNode = new ComparableNode(node);
>         LOGGER.info("Nodename4="+cmpNode.getNode());
>
> The node itself partially contains a same-name sibling; by retrieving the node
> from my ComparableNode I lose the index of the sibling.
> So when researching: /content/sibling[2]/mynode
> I get these messages:
> Nodename1=/content/sibling[2]/mynode
> Nodename2=/content/sibling[2]/mynode
> Nodename3=/content/sibling/mynode
> Nodename4=/content/sibling/mynode
>
> As you can see the node itself is stored to a final variable by the
> constructor
> of ComparableNode. But when retrieving it, it represents a different node.
>
> Any idea, whats going on here?
>
> brgds,
> Ulrich

Mime
View raw message