-
Bug
-
Resolution: Done
-
Major
-
3.6.0.Final
-
None
According to API , NodeIterator.hasNext() method should return same result if next() method is not called meanwhile. This is not the case in some situations, when I do some node adding combined with calling clone().
Fortunately there is a workaround to call session.save() before calling hasNext() method. See attached code.
example:
NodeIterator nodeIter = refNode.getNodes("name"); boolean hasnext1 = nodeIter.hasNext(); boolean hasnext2 = nodeIter.hasNext(); boolean hasnext3 = nodeIter.hasNext(); System.out.println("CALL1" + hasnext1); System.out.println("CALL2" + hasnext2); System.out.println("CALL3" + hasnext3);
will output:
CALL1true CALL2false CALL3false