[jbosstools-dev] @Target for qualifier type
Alexey Kazakov
akazakov at exadel.com
Tue Nov 23 09:27:46 EST 2010
Hi Pete,
Could you take a look at https://jira.jboss.org/browse/JBIDE-7710
JSR-299 says that a qualifier type is a Java annotation defined as
@Target({METHOD, FIELD, PARAMETER, TYPE}) or @Target({FIELD, PARAMETER})
(an event qualifier type):
/2.3.2. Defining new qualifier types/
/A qualifier type is a Java annotation defined as @Target({METHOD,
FIELD, PARAMETER, TYPE}) and @Retention(RUNTIME)./
/.../
/10.1. Event types and qualifier types/
/.../
/An event qualifier type is just an ordinary qualifier type as
specified in Section 2.3.2, “Defining new qualifier types” with the
exception that it may be declared @Target({FIELD, PARAMETER})./
/.../
But the spec doesn't require to treat other kinds of @Target (for
example @Target({FIELD, METHOD, PARAMETER} which is used in weld-jsf-jee
archetype) as a definition error.
It seems that we got it wrong and if there is any @Target except
@Target({METHOD, FIELD, PARAMETER, TYPE}) or @Target({FIELD, PARAMETER})
then JBT marks such definitions as errors:
/Qualifier annotation type must be annotated with @Target({TYPE,
METHOD, FIELD, PARAMETER}) or @Target({METHOD, FIELD}) [JSR-299
§2.3.2, §10.1]/
Can you confirm that actually a qualifier type could have any @Target?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jbosstools-dev/attachments/20101123/2c302847/attachment.html
More information about the jbosstools-dev
mailing list