[cdi-dev] Challenge TCK test for indirect specialization rules
mkouba at redhat.com
Tue Jun 3 05:27:16 EDT 2014
For the record: the TCK team does think that a bean may have "direct
specialization" and "indirect specialization" relationship in the same
time. In other words, for "X extends Z extends Y", where both X and Z
are annotated with @Specializes, X not only "directly specializes" Z but
also "indirectly specializes" Y. Beans Z and Y are ignored because
they're specialized by X.
However, I do agreee that some explicit wording/clarification in this
area would be appropriate.
Dne 3.6.2014 10:37, Mark Struberg napsal(a):
> The question is about
> and a few other tests in there.
> Imo they directly contradict 4.3.1 of the spec:
> Formally, a bean X is said to specialize another bean Y if either:
> • X directly specializes Y, or
> • a bean Z exists, such that X directly specializes Z and Z specializes Y. Then X will inherit the qualifiers and bean name of Y:
> • the qualifiers of X include all qualifiers of Y, together with all qualifiers declared explicitly by X, and
> • if Y has a bean name, the bean name of X is the same as the bean name of Y.
> in this wording the 'intermediate class' Z in the inheritance chain X -> Z -> Y intentionally gets ignored imo.
> It explicitly doesn't say that 'all @Specializes up in the chain' do account for the name and qualifiers.
> To me it reads like the 'last' (outermost) @Specializes and the 'first' non-specializes beans do count. All @Specializes beans in-between get ignored when it comes to @Named and @Qualifier resolution.
> There was imo also a test for it in the CDI-1.0 TCK which we did successfully pass. But obviously this got rewritten to a different behavior.
> Here is the transcript of my discussion with martin and jozef so far:
> txs and LieGrue,
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
More information about the cdi-dev