-
1. Re: Question on Qualifiers
wujek Mar 20, 2010 12:33 AM (in response to wujek)I checked this and NonQualifier is not considered a valid qualifierwhen I don't use the meta annotation @Qualifier. It only works when used in BeforeBeanDiscovery. Is this on purpose? Moreover, when I change the annotation to not comply to the mentioned contract, it still works (for example, Target set to ElementType.FIELD only still works).
This looks like either this behaviour is not specs-compliant in this regard, or the specs do not fully explain what and when should happen.
Can someone clarify?Wujek
-
2. Re: Question on Qualifiers
nickarls Mar 20, 2010 10:15 PM (in response to wujek)You are correct on the point that it's the @Qualifier meta-annotation that makes an annotation a qualifier (and no non-qualifier should ever have it, surprise, surprise)
If I recall correctly, addQualifier in BBD gets an implicit @Qualifier added
The @Target is not really checked, it's more for the compiler than CDI. If CDI checks a field and finds a qualifier, it doesn't care if the same qualifier can't be placed on a method. Technically it might be a breach of spec but I don't see how anyone could do that much damage (more than limiting oneself intentionally)
-
3. Re: Question on Qualifiers
wujek Mar 21, 2010 8:28 AM (in response to wujek)
Nicklas Karlsson wrote on Mar 20, 2010 22:15:
You are correct on the point that it's the @Qualifier meta-annotation that makes an annotation a qualifier (and no non-qualifier should ever have it, surprise, surprise)
If I recall correctly, addQualifier in BBD gets an implicit @Qualifier addedSo this sounds like it is somewhat not what the specs says. It says that a Qualifier may have @Qualifier meta-annotation, and I also couldn't find anything about automatically adding this annotatino in BBD. From the end user point of view I think CDI specs should specifically describe this, now it is very confusing.
-
4. Re: Question on Qualifiers
nickarls Mar 21, 2010 11:32 AM (in response to wujek)You could file a JIRA for it.
-
5. Re: Question on Qualifiers
wujek Mar 22, 2010 10:41 AM (in response to wujek)Could you tell me where such an issue should be filed? Somewhere under CDI API maybe?
-
6. Re: Question on Qualifiers
nickarls Mar 22, 2010 12:03 PM (in response to wujek)On closer thought, perhaps a mail to the JSR-299 EG might be a better since it would be good to have feedback from there what can't/should be done...