Skip to content

Fix Lists.transform and other collection views to preserve spliterato…#8444

Open
giruuuuj wants to merge 1 commit into
google:masterfrom
giruuuuj:fix-spliterator-characteristics-8165
Open

Fix Lists.transform and other collection views to preserve spliterato…#8444
giruuuuj wants to merge 1 commit into
google:masterfrom
giruuuuj:fix-spliterator-characteristics-8165

Conversation

@giruuuuj

Copy link
Copy Markdown

…r/iterator characteristics

  • Update CollectSpliterators.filter() to preserve IMMUTABLE and CONCURRENT characteristics (they describe the source, not elements)
  • Add spliterator() overrides to Lists.OnePlusArrayList, TwoPlusArrayList, StringAsList, and AbstractListWrapper (which fixes Lists.transform via TransformingRandomAccessList/SequentialList)
  • Add spliterator() overrides to Maps.KeySet (with DISTINCT) and Maps.Values
  • Apply same fixes to android variant copies

Fixes #8165

…r/iterator characteristics

- Update CollectSpliterators.filter() to preserve IMMUTABLE and CONCURRENT
  characteristics (they describe the source, not elements)
- Add spliterator() overrides to Lists.OnePlusArrayList, TwoPlusArrayList,
  StringAsList, and AbstractListWrapper (which fixes Lists.transform via
  TransformingRandomAccessList/SequentialList)
- Add spliterator() overrides to Maps.KeySet (with DISTINCT) and Maps.Values
- Apply same fixes to android variant copies

Fixes google#8165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lists::transform and probably others do not produce spliterators/iterators with correct characteristics

2 participants