Open rjbird77 opened 2 years ago
Hi @rjbird77, this issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.
The same issue in the latest Twilio Java SDK 10.1.0 as well. I'm using Java 17
Issue Summary
ResourceSet implement Iterable, but its implementation is flawed. You can only iterate through its elements once, even if you get a new iterator.
ResourceSet implements Iterable and has inner class ResourceSetIterator for its iterator internally. The implementation of ResourceSetIterator uses class variables from ResourceSet, specifically ResourceSet.iterator and ResourceSet.processed. Because of this, even though ResourceSet.iterator() method does create a new instance of ResourceSetIterator, since the processed count and the iterator in the outer class never get reset, it is functionally still at the end (hasNext() method returns false).
Steps to Reproduce
Code Snippet
Exception/Log
Technical details: