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

Consider supporting Collection types as injection target #93

Open
cstamas opened this issue Aug 1, 2023 · 0 comments
Open

Consider supporting Collection types as injection target #93

cstamas opened this issue Aug 1, 2023 · 0 comments

Comments

@cstamas
Copy link
Member

cstamas commented Aug 1, 2023

Currently injected collection types supported are Set and List, but not Collection.

So something like this is currently not possible:

@Inject
public MyCtor(Collection<MyComponent> myComponents) {
...

Despite I may have Set or List injected. We may want to broaden and recognize these situations as Java would allow passing of Set or List into this ctor.

PS: This just came to my attention, as for example former Aether (Maven Resolver) is full of these:
https://github.com/apache/maven-resolver/blob/maven-resolver-1.9.14/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java#L58

(injects Set, only to pass to method using Collection and primate member is Collection as well).

@cstamas cstamas changed the title Consider supporting Collection types Consider supporting Collection types as injection target Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant