Skip to content

Improve CollectionFactory to allow for single statement collection creation #28025

@snicoll

Description

@snicoll

Right now CollectionFactory allows to create a collection type, trying to find the most suitable implementation based on an concrete instance.

We have some use cases in AOT where we'd like to be able to streamline the creation of a collection in a single statement. We've tried something along those lines:

Stream.of(new RuntimeBeanReference("myCommandHandler")).collect(Collectors.toCollection(ManagedList::new))

Unfortunately the indirection with the collector can easily confuse the compiler. A more direct use where the collectionFactory would be provided with a bunch of elements could be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions