<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
I think this is a spec issue. The spec should make it clearer that
a "resolvable type variable" means a type variable that can be
resolved to a reference type other than a type variable.<br>
<br>
Jozef<br>
<br>
On 04/30/2014 09:32 PM, Arne Limburg wrote:<br>
</div>
<blockquote
cite="mid:CF8700DC.41E11%25arne.limburg@openknowledge.de"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div>Hi,</div>
<div><br>
</div>
<div>I found an issue in either the spec or the tck, which I would
like to discuss:</div>
<div>The
TCK-Test org.jboss.cdi.tck.tests.event.fires.FireEventTest.testTypeVariableEventTypeFails</div>
<div>uses the following bean to fire an event by calling the
method fireWithTypeVariable()</div>
<div><br>
</div>
<div>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;
color: rgb(147, 26, 104);">
public<span style="color: #000000"> </span>class<span
style="color: #000000"> Bar {</span></p>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;
min-height: 15px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;
color: rgb(119, 119, 119);">
<span style="color: #000000"> </span>@Inject</p>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;">
<span style="color: #931a68">
private</span> Event<Foo<? <span style="color:
#931a68">extends</span> Number>> <span style="color:
#0326cc">
event</span>;</p>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;
min-height: 15px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;">
<span style="color: #931a68">
public</span> <T <span style="color: #931a68">extends</span>
Number> <span style="color: #931a68">
void</span> fireWithTypeVariable() {</p>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;">
<span style="color: #0326cc">
event</span>.fire(<span style="color: #931a68">new</span>
Foo<T>());</p>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;">
}</p>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;
min-height: 15px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Monaco;">}</p>
</div>
<div><br>
</div>
<div>The TCK expects this test to fail because of the type
variable in the instance created by new Foo<T>()</div>
<div>However, the spec states in 10.3.1 „<span style="font-family:
Helvetica; font-size: 10px;">If the container </span><span
style="font-family: Helvetica; font-size: 10px;">is unable to
resolve the parameterized type of the event object, it uses
the specified type to infer the parameterized type of the </span><span
style="font-family: Helvetica; font-size: 10px;">event types.</span>“</div>
<div>Imho in this case the container is able to resolve T to "?
extends Number“ and the spec does not prohibit an event to have
a wildcard type. So since T is not unresolvable, this test case
should not expect the container to throw an exception. If we
consider T not to be resolved, because it resolves to a wildcard
type, we should mention this somewhere in the spec. Or am I
missing something?</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Arne</div>
<div>
</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>