<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I'd say it's a bug. While Baz indeed is
a managed bean, it shouldn't be injected into injection point with
type Baz<String> nor Baz<List<Qux>>. So I
believe you're right in saying that this test should fail with
UnsatisfiedResolutionException.<br>
<br>
There was a change made to the spec way back in 2010 (see [1]),
but the TCK apparently wasn't updated then. I've filed an issue in
the TCK jira [2]. <br>
<br>
The problem isn't only in the TCK, but also in the spec itself.
Some of the examples in section 5.2.4 don't conform to the rules
defined in the same section (according to the rules, bean Dao<T
extends Persistent> shouldn't be eligible for injection into
Dao<Order> or Dao<User>). I remember asking about this
a year ago ([3]), but I didn't articulate the problem properly.<br>
<br>
[1] <a
href="https://github.com/cdi-spec/cdi/commit/b32243350ace6a0bba337f91a35f5fd05c151f14">https://github.com/cdi-spec/cdi/commit/b32243350ace6a0bba337f91a35f5fd05c151f14</a><br>
[2] <a href="https://issues.jboss.org/browse/CDITCK-349">https://issues.jboss.org/browse/CDITCK-349</a><br>
[3] <a
href="http://lists.jboss.org/pipermail/cdi-dev/2012-April/001742.html">http://lists.jboss.org/pipermail/cdi-dev/2012-April/001742.html</a><br>
<br>
Marko<br>
<br>
On 7.7.2013 16:04, Arne Limburg wrote:<br>
</div>
<blockquote
cite="mid:CDFF4211.2D49A%25arne.limburg@openknowledge.de"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div style="font-family: Calibri, sans-serif; ">Hi all,</div>
<div style="font-family: Calibri, sans-serif; "><br>
</div>
<div style="font-family: Calibri, sans-serif; ">At the
OpenWebBeans list we are currently discussing handling of
generics in CDI.</div>
<div><font face="Calibri,sans-serif">I found a test in the CDI 1.1
TCK, which imho has a bug. The test
is org.jboss.cdi.tck.tests.inheritance.generics.MemberLevelInheritanceTest
and
</font>the (simplified) deployment scenario is the following:</div>
<div><br>
</div>
<div>
<div style="font-size: medium; ">public class Baz<T> {</div>
<div style="font-size: medium; ">}</div>
<div style="font-size: medium; "><br>
</div>
<div style="font-size: medium; ">public class Qux extends
Baz<String> {</div>
<div style="font-size: medium; ">}</div>
<div style="font-size: medium; "><br>
</div>
<div style="font-size: medium; ">@Vetoed</div>
<div style="font-size: medium; ">public class Bar<T1, T2>
{</div>
<div style="font-size: medium; "> @Inject</div>
<div style="font-size: medium; "> private Baz<T1> baz;</div>
<div style="font-size: medium; "> @Inject</div>
<div style="font-size: medium; "> private
Baz<List<T2>> t2BazList;</div>
<div style="font-size: medium; ">}</div>
<div style="font-size: medium; "><br>
</div>
<div style="font-size: medium; ">@RequestScoped</div>
<div style="font-size: medium; ">public class Foo extends
Bar<String, Qux> {</div>
<div style="font-size: medium; ">}</div>
<div style="font-size: medium; "><br>
</div>
<div style="font-size: medium; ">public class Producer {</div>
<div style="font-size: medium; "> @Produces</div>
<div style="font-size: medium; "> @Amazing</div>
<div style="font-size: medium; "> public String produceString()
{</div>
<div style="font-size: medium; "> return "ok";</div>
<div style="font-size: medium; "> }</div>
<div style="font-size: medium; "><br>
</div>
<div style="font-size: medium; "> @Produces</div>
<div style="font-size: medium; "> public String[]
produceStringArray() {</div>
<div style="font-size: medium; "> return new String[0];</div>
<div style="font-size: medium; "> }</div>
<div style="font-size: medium; "><br>
</div>
<div style="font-size: medium; "> @Produces</div>
<div style="font-size: medium; "> public
Baz<Baz<Qux>> produceBazBazQux() {</div>
<div style="font-size: medium; "> return new Baz();</div>
<div style="font-size: medium; "> }</div>
<div style="font-size: medium; ">}</div>
</div>
<div>
<div style="font-size: medium; "><br>
</div>
<div style="font-size: medium; ">The class Bar has some more
injection points, but that does not matter.</div>
<div style="font-size: medium; ">Due to the TCK this deployment
should work, but I don't know how.</div>
<div style="font-size: medium; ">Question: Is Baz a Bean (I
suppose so) and may it be injected into Bean Foo, more
precisely into the second injection point of class Bar?</div>
<div style="font-size: medium; ">- If yes, it also should be
injected into the first injection point, right? This would
lead to an AmbiguousResolutionException since Qux may also be
injected into the first injection point.</div>
<div style="font-size: medium; ">- If no, the deployment should
fail with a UnsatisfiedResolutionException since there is no
Bean that can be injected into that injection point.</div>
<div style="font-size: medium; "><br>
</div>
<div style="font-size: medium; ">Is this a bug in the TCK and if
not, how is this supposed to work?</div>
</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Arne</div>
<div style="font-family: Calibri, sans-serif; ">
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cdi-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/cdi-dev">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></pre>
</blockquote>
<br>
</body>
</html>