Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COLLECTIONS-770 When creating an iterator chain containing other iterator chains flatten the resulting internal object. #308

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stevebosman-oc
Copy link
Contributor

Contributed on behalf of the @opencastsoftware open source team

I am slightly wary of opening up UnmodifiableIterator, but this seems to solve the performance degradation of nested IteratorChains seen in COLLECTIONS-770

…ator chains flatten the resulting internal object.
@codecov-commenter
Copy link

Codecov Report

Merging #308 (2257274) into master (1677dac) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #308      +/-   ##
============================================
+ Coverage     85.87%   85.88%   +0.01%     
- Complexity     4676     4683       +7     
============================================
  Files           292      292              
  Lines         13469    13482      +13     
  Branches       1955     1959       +4     
============================================
+ Hits          11566    11579      +13     
  Misses         1326     1326              
  Partials        577      577              
Impacted Files Coverage Δ
.../commons/collections4/iterators/IteratorChain.java 88.88% <100.00%> (+2.61%) ⬆️
...s/collections4/iterators/UnmodifiableIterator.java 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1677dac...2257274. Read the comment docs.

…ator chains flatten the resulting internal object. Fix checkstyle issues
Copy link
Contributor

@Claudenw Claudenw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test code does not duplicate the code in the bug report COLLECTIONS-770 nor the closely related COLLECTIONS-722. I would like to see both implemented if possible.

Comment on lines +194 to +198
try {
iteratorChainOfChains.next();
} catch (final Exception e) {
assertEquals("NoSuchElementException must be thrown", e.getClass(), NoSuchElementException.class);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this with assertThrows()

Comment on lines +217 to +221
try {
iteratorChainOfChains.next();
} catch (final Exception e) {
assertEquals("NoSuchElementException must be thrown", e.getClass(), NoSuchElementException.class);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this with assertThrows()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants