If PSTFolder has an error in getNextChild it leaves PSTFolder object in a state where it can never advance to the next child.
Example of exception that leaves PSTFolder in a bad state:
Exception com.pff.PSTException: Unable to find 2098852 is desc: true
at PSTFile.findBtreeItem (PSTFile.java:756)
at PSTFile.getDescriptorIndexNode (PSTFile.java:773)
at PSTFolder.getNextChild (PSTFolder.java:295)
Believe this could be overcome by incrementing this.currentEmailIndex ahead of doing the work of creating the child object.
Might also be better to give users a simple API to get children at a specific index.
My present work-around is to attempt to use the PstFolder::moveChildCursorTo method to advance manually, and keep track fo the current index outside of PSTFolder. (still testing code not 100% on if this strategy works as expected).
If PSTFolder has an error in getNextChild it leaves PSTFolder object in a state where it can never advance to the next child.
Example of exception that leaves PSTFolder in a bad state:
Believe this could be overcome by incrementing
this.currentEmailIndex
ahead of doing the work of creating the child object.Might also be better to give users a simple API to get children at a specific index.
My present work-around is to attempt to use the PstFolder::moveChildCursorTo method to advance manually, and keep track fo the current index outside of PSTFolder. (still testing code not 100% on if this strategy works as expected).