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

Dependencies should be allowed to have multiple qualifier annotations. #201

Closed
ambition-consulting opened this issue May 31, 2015 · 6 comments

Comments

@ambition-consulting
Copy link

Would you consider merging a well written+tested pull request, allowing dependencies to have multiple qualifier annotations? Are there any plans that I would need to be aware of before starting?

@JakeWharton
Copy link

JSR330 forbids this.

On Sun, May 31, 2015, 1:04 PM John-Paul Cunliffe notifications@github.com
wrote:

Would you consider merging a well written+tested pull request, allowing
dependencies to have multiple qualifier annotations? Are there any plans
that I would need to be aware of before starting?


Reply to this email directly or view it on GitHub
#201.

@ambition-consulting
Copy link
Author

That ... is unfortunate. Are annotation compositions allowed?

@JakeWharton
Copy link

You can put explicit combinations together in a specific new annotation's
members but you cannot arbitrarily define an annotation for combing any
number of annotations.

On Sun, May 31, 2015, 2:01 PM John-Paul Cunliffe notifications@github.com
wrote:

That ... is unfortunate. Are annotation compositions allowed?


Reply to this email directly or view it on GitHub
#201 (comment).

@ambition-consulting
Copy link
Author

I had a feeling you would say that. I can see how this spec simplifies qualifiers, but it still feels inappropriately limiting.

In any case, this issue can be closed.

@hjohn
Copy link

hjohn commented Dec 7, 2021

JSR330 forbids this.

This is incorrect, from the JSR-330 @Inject docs, emphasis mine:

A qualifier may annotate an injectable field
or parameter and, combined with the type, identify the implementation to
inject. Qualifiers are optional, and when used with @Inject in
injector-independent classes, no more than one qualifier should annotate a
single field or parameter.

This states that no more than one qualifier should annotate a single field or parameter if you want to remain injector-independent. The wording was specifically changed to allow for multiple qualifiers as long as users understand that this means they might be tied to a specific injector implementation. See discussion here, last few comments: https://code.google.com/archive/p/atinject/issues/2

@NadChel
Copy link

NadChel commented May 23, 2024

Shall we reopen then?

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

4 participants