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