[
https://jira.jboss.org/browse/JBIDE-7710?page=com.atlassian.jira.plugin.s...
]
Alexey Kazakov commented on JBIDE-7710:
---------------------------------------
I've asked Pete about @Target:
> 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 definitionsas
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?
And here is his answer:
I think it should have the @Target's that the spec describes, anything else is
non-portable. Erroring, or maybe warning (I would prefer an error), is a good idea.
JBT 3.2 (beta 1) saying weld archetypes are not JSR 299 compliant
-----------------------------------------------------------------
Key: JBIDE-7710
URL:
https://jira.jboss.org/browse/JBIDE-7710
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: cdi (jsr-299), maven
Affects Versions: 3.2.0.Beta1
Environment: Helios 3.6.1, WTP 3.2.2, m2eclipse 0.12.0, m2eclipse-wtp 0.11.1
Reporter: Fred Bricon
Assignee: Alexey Kazakov
Fix For: 3.2.0.CR1
Attachments: cdi-violations.jpg
Hi
so, using JBoss Tools 3.2.0 beta 1, I got these errors when creating a project using the
weld-jsf-jee archetype :
WidgetRepositoryProducer.java L19 : Non-static method of a session bean class has a
parameter annotated @Disposes, and the method is not a business method of the session bean
[JSR-299 §3.3.6]
WidgetRepositoryProducer.java L 15 : Non-static method of a session bean class is
annotated @Produces, and the method is not a business method of the session bean [JSR-299
§3.3.2]
WidgetListProducer.java L 17: Producer method with a parameterized return type with a
type variable must be @Dependent scoped [JSR-299 §3.3]
WidgetRepository.java L 11 : Qualifier annotation type must be annotated with
@Target({TYPE, METHOD, FIELD, PARAMETER}) or @Target({METHOD, FIELD}) [JSR-299 §2.3.2,
§10.1]
Dan Allen assures me the archetypes are fully compliant, so the validation implementation
must be off, somehow.
Maybe this behavior has changed in JBT 3.2 beta 2, in which case I apologize for the
noise.
Regards,
Fred Bricon
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira