CDI @Target Warning on Netbeans

In my web project using CDI Netbeans 7.1.2 warns about my custom qualifier

@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({FIELD, TYPE, METHOD})
public @interface MyQualifier{

}

with the message:

The CDI Annotation is declared as Qualifier but it has wrong target values. Correct target values are '{METHOD, FIELD, PARAMETER, TYPE'} or '{FIELD, PARAMETER'}.

Yes, this is just a warning, but I’m still interested to know the meaning of this message. Could not find a good link on @Targetthe net. Therefore, someone here can give some explanation about the Target and warning message. Thank.

+3
source share
1 answer

It appears that according to section 2.3.2 of the CDI specification, they are both incorrect. The qualifier must be METHOD, FIELD, PARAMETER, TYPE.

+1
source

All Articles