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

Allow Collection Selection/Projection to be applied to instances of Iterable [SPR-13231] #17822

spring-projects-issues opened this issue Jul 14, 2015 · 1 comment


Copy link

@spring-projects-issues spring-projects-issues commented Jul 14, 2015

Andrew Whitehead opened SPR-13231 and commented

Currently Collection Selection/Projection only operates on Maps, Collections and Arrays.

It would be nice if it also supported instances of Iterator and Iterable so that the same functionality can be achieved without requiring user objects to implement the entire Collection interface, or wrapping them in a Collection.

The implementation of org.springframework.expression.spel.ast.Selection#getValueRef and org.springframework.expression.spel.ast.Projection#getValueRef only iterate over the collections anyway (after copying them into a List), so it doesn't seem like the extra functionality in Collection is required.

Referenced from: commits 0783a1c

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 15, 2015

Juergen Hoeller commented

Let's reduce this to Iterable, being able to produce a fresh Iterator every time, since a directly exposed Iterator would otherwise be fully consumed afterwards (which we don't support in other places either).


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants