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

Closed
spring-issuemaster opened this issue Jul 14, 2015 · 1 comment
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster 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

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster 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).

Juergen

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.