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

ArrayToCollectionConverter should default to List if target type is Collection #28048

Closed
odrotbohm opened this issue Feb 14, 2022 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@odrotbohm
Copy link
Member

odrotbohm commented Feb 14, 2022

If one asks ArrayToCollectionConverter to convert an array to a Collection the delegating call to CollectionFactory results in a LinkedHashSet being used as conversion target.

I think it makes sense to rather default to a List based implementation in that particular case, as arrays naturally allow duplicates and retain order and handing a Collection as conversion target kind of indicates no preference in whether to retain those semantics or rather drop duplicates.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 14, 2022
@jhoeller jhoeller added the in: core Issues in core modules (aop, beans, core, context, expression) label Feb 14, 2022
@jhoeller jhoeller added this to the Triage Queue milestone Feb 14, 2022
@quaff

This comment was marked as outdated.

@jhoeller jhoeller added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on for: team-meeting labels Jun 14, 2022
@jhoeller jhoeller modified the milestones: Triage Queue, 6.0.x Jun 14, 2022
@jhoeller jhoeller modified the milestones: 6.0.x, 6.x Backlog Jan 11, 2023
@jhoeller jhoeller modified the milestones: 6.x Backlog, 6.1.0-M2 Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants