Hello Community,

we are introducing the paging capability into our app, and run into a
behavior which is not very clear to us:

ItemIterable<CmisObject> children = ((Folder) obj).getChildren();
int count = 0;
for (CmisObject o : children)
{
count++;
}
int count2 = 0;
for (CmisObject o : children)
{
count2++;
}
assertEquals(count, count2);

And that simple test is failing since count2 will always be 0, that leads
to the assumption that ItemIterable is stateful. Reading the documentation
didn't bring any information to our conclusion.

One of the developers found following place:
org.apache.chemistry.opencmis.client.runtime.util.AbstractIterable.getIterator()
which is creating the stateful behavior.

Could someone clarify the behavior?
Comparing to the java-Iterable implementation it looks like a bug, but
maybe there is a reason for the behavior in OpenCMIS framework.

Kind Regards,
Alex

Reply via email to