<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Actually, it will never be the same
      instance, since all beans with a parameterized bean class must be
      @Dependent scoped.<br>
      <br>
      Marko<br>
      <br>
      On 15.7.2013 23:46, Arne Limburg wrote:<br>
    </div>
    <blockquote
      cite="mid:CE0A3996.2D97D%25arne.limburg@openknowledge.de"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div>No, I understood you right ;-)</div>
      <div>In Java the same instance cannot be MyClass&lt;String&gt; and
        MyClass&lt;Integer&gt; at the same time.</div>
      <div>We would do exactly that, if we had two injection points like</div>
      <div>@Inject</div>
      <div>MyClass&lt;String&gt; myStringClass;</div>
      <div>@Inject</div>
      <div>MyClass&lt;Integer&gt; myIntegerClass;</div>
      <div>In plain java this could never be the same instances without
        heavy (compile-time) casting, thus this should not be the same
        instances in CDI.</div>
      <div><br>
      </div>
      <div>Cheers,</div>
      <div>Arne</div>
      <div><br>
      </div>
      <span id="OLK_SRC_BODY_SECTION">
        <div style="font-family:Calibri; font-size:11pt;
          text-align:left; color:black; BORDER-BOTTOM: medium none;
          BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT:
          0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid;
          BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
          <span style="font-weight:bold">Von: </span>Romain Manni-Bucau
          &lt;<a moz-do-not-send="true"
            href="mailto:rmannibucau@gmail.com">rmannibucau@gmail.com</a>&gt;<br>
          <span style="font-weight:bold">Datum: </span>Montag, 15. Juli
          2013 23:41<br>
          <span style="font-weight:bold">An: </span>Arne Limburg &lt;<a
            moz-do-not-send="true"
            href="mailto:arne.limburg@openknowledge.de">arne.limburg@openknowledge.de</a>&gt;<br>
          <span style="font-weight:bold">Cc: </span>Mark Struberg &lt;<a
            moz-do-not-send="true" href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt;,
          Martin Kouba &lt;<a moz-do-not-send="true"
            href="mailto:mkouba@redhat.com">mkouba@redhat.com</a>&gt;, "<a
            moz-do-not-send="true" href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a>"
          &lt;<a moz-do-not-send="true"
            href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a>&gt;<br>
          <span style="font-weight:bold">Betreff: </span>Re: [cdi-dev]
          CDI and generics<br>
        </div>
        <div><br>
        </div>
        <div>
          <div>hmm think you misunderstood what i said (sorry if it was
            unclear)
            <div><br>
            </div>
            <div>basically my point was a generic bean or produced bean
              should be injectable everywhere so MyClass&lt;T&gt; should
              match @Inject MyClass&lt;String&gt;. In plain java we do:
              new MyClass&lt;String&gt;().</div>
            <div><br clear="all">
              <div>
                <div><i>Romain Manni-Bucau</i></div>
                <div><i>Twitter: <a moz-do-not-send="true"
                      href="https://twitter.com/rmannibucau"
                      target="_blank">@rmannibucau</a></i></div>
                <div><i>Blog: </i><a moz-do-not-send="true"
                    href="http://rmannibucau.wordpress.com/"
                    target="_blank"><i>http://rmannibucau.wordpress.com/</i></a></div>
                <div><i>LinkedIn: </i><font color="#0000ee"><i><u><a
                          moz-do-not-send="true"
                          href="http://fr.linkedin.com/in/rmannibucau"
                          target="_blank">http://fr.linkedin.com/in/rmannibucau</a></u></i></font></div>
                <div><i><span style="background-color:rgb(255,255,255)">Github: </span><a
                      moz-do-not-send="true"
                      href="https://github.com/rmannibucau"
                      target="_blank">https://github.com/rmannibucau</a></i></div>
                <div><br>
                </div>
              </div>
              <br>
              <br>
              <div class="gmail_quote">2013/7/15 Arne Limburg <span
                  dir="ltr">&lt;<a moz-do-not-send="true"
                    href="mailto:arne.limburg@openknowledge.de"
                    target="_blank">arne.limburg@openknowledge.de</a>&gt;</span><br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div style="word-wrap:break-word">
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">
                      <div>
                        <div>Hi Romain,</div>
                      </div>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">In
                      plain old java the behavior would depend on where
                      the type variable is declared.</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">See
                      the following samples:</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">public
                      class MyClass&lt;T&gt; {</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"> 
                        List&lt;T&gt; myList = new ArrayList&lt;T&gt;();</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"> 
                        List&lt;String&gt; myStringList = myList;</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">}</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">public
                      class MyClass {</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"> 
                        &lt;T&gt; List&lt;T&gt; myList() {</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"> 
                            return new ArrayList&lt;T&gt;();</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"> 
                        }</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"> 
                        List&lt;String&gt; myStringList = myList();</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">}</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">The
                      first example does not work and the second works.</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">And
                      even, if you would access myList from outside, the
                      first example just works, if you instantiate
                      myClass with the type argument:</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">List&lt;String&gt;
                      myStringList = new MyClass&lt;String&gt;().myList;</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">To
                      transfer this to CDI: We would need an instance of
                      Bean MyClass with MyClass&lt;String&gt; in the
                      type closure. And we would have to do this for
                      every type argument that can be found within the
                      injection points, i.e., if we had the injection
                      points</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">@Inject</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">MyClass&lt;String&gt;
                      myStringClass;</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">@Inject</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">MyClass&lt;Integer&gt;
                      myIntegerClass;</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">either
                      the type closure of my class would have to contain
                      MyClass&lt;String&gt; AND MyClass&lt;Integer&gt;
                      or we would need to have different beans for both
                      types. I think, we cannot do either.</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif">I
                      suggest to handle TypeVariables declared at class
                      level different than TypeVariables declared at
                      (producer-)method level. Thus we could handle Mark
                      Strubergs case and leave the rest like it is in
                      plain old java.</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <div><font style="font-size:14px"
                        face="Calibri,sans-serif">I suggest to change
                        the fourth bullet po</font>int of chapter 5.2.4:</div>
                    <div>"the required type parameter is an actual type,
                      the bean type parameter is a type variable that is
                      declared at class level and the actual type is
                      assignable from the upper bound of the type
                      variable,"</div>
                    <div>and add another bullet point:</div>
                    <div>"the required type parameter is an actual type,
                      the bean type parameter is a type variable that is
                      declared at method level and the actual type is
                      assignable to the upper bound of the type
                      variable, or"</div>
                    <div>And add a footnote: "If no explicit upper bound
                      is defined, the implicit upper bound
                      java.lang.Object is assumed"</div>
                    <div><br>
                    </div>
                    <div>BTW. Should we create a spec issue for that?</div>
                    <div><br>
                    </div>
                    <div>WDYT?</div>
                    <div>Regards,</div>
                    <div>Arne</div>
                    <div><br>
                    </div>
                    <div>P.S.: I don't think this is a backward
                      compatibility issue, just because Weld and
                      OpenWebBeans implemented it differently in the
                      past. It just was not clear in 1.0 and is not in
                      1.1. The misleading part is the "if any" in the
                      fourth bullet point. A TypeVariable ALWAYS has an
                      upper bound. "If no bound is given for a type
                      variable, Object is assumed" (Java Lang Spec 4.4)</div>
                    <div
                      style="font-size:14px;font-family:Calibri,sans-serif"><br>
                    </div>
                    <span style="font-size: 14px; font-family: Calibri,
                      sans-serif; ">
                      <div style="border-right:medium
                        none;padding-right:0in;padding-left:0in;padding-top:3pt;text-align:left;font-size:11pt;border-bottom:medium
                        none;font-family:Calibri;border-top:#b5c4df 1pt
                        solid;padding-bottom:0in;border-left:medium
                        none">
                        <span style="font-weight:bold">Von: </span>Romain
                        Manni-Bucau &lt;<a moz-do-not-send="true"
                          href="mailto:rmannibucau@gmail.com"
                          target="_blank">rmannibucau@gmail.com</a>&gt;<br>
                        <span style="font-weight:bold">Datum: </span>Montag,
                        15. Juli 2013 07:55<br>
                        <span style="font-weight:bold">An: </span>Mark
                        Struberg &lt;<a moz-do-not-send="true"
                          href="mailto:struberg@yahoo.de"
                          target="_blank">struberg@yahoo.de</a>&gt;<br>
                        <span style="font-weight:bold">Cc: </span>Martin
                        Kouba &lt;<a moz-do-not-send="true"
                          href="mailto:mkouba@redhat.com"
                          target="_blank">mkouba@redhat.com</a>&gt;,
                        Arne Limburg &lt;<a moz-do-not-send="true"
                          href="mailto:arne.limburg@openknowledge.de"
                          target="_blank">arne.limburg@openknowledge.de</a>&gt;,
                        "<a moz-do-not-send="true"
                          href="mailto:cdi-dev@lists.jboss.org"
                          target="_blank">cdi-dev@lists.jboss.org</a>"
                        &lt;<a moz-do-not-send="true"
                          href="mailto:cdi-dev@lists.jboss.org"
                          target="_blank">cdi-dev@lists.jboss.org</a>&gt;<br>
                        <span style="font-weight:bold">Betreff: </span>Re:
                        [cdi-dev] CDI and generics<br>
                      </div>
                      <div>
                        <div class="h5">
                          <div><br>
                          </div>
                          <div>
                            <div>
                              <p
                                style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">+1,
                                if we are no more aligned on something
                                so simple in plain java we are useless i
                                fear :(</p>
                              <p
                                style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">(i
                                used and saw it used in a lot of real
                                apps)</p>
                              <p
                                style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><br>
                              </p>
                              <div>
                                <div><i>Romain Manni-Bucau</i></div>
                                <div><i>Twitter: <a
                                      moz-do-not-send="true"
                                      href="https://twitter.com/rmannibucau"
                                      target="_blank">@rmannibucau</a></i></div>
                                <div><i>Blog: </i><a
                                    moz-do-not-send="true"
                                    href="http://rmannibucau.wordpress.com/"
                                    target="_blank"><i>http://rmannibucau.wordpress.com/</i></a></div>
                                <div><i>LinkedIn: </i><font
                                    color="#0000ee"><i><u><a
                                          moz-do-not-send="true"
                                          href="http://fr.linkedin.com/in/rmannibucau"
                                          target="_blank">http://fr.linkedin.com/in/rmannibucau</a></u></i></font></div>
                                <div><i><span style="">Github: </span><a
                                      moz-do-not-send="true"
                                      href="https://github.com/rmannibucau"
                                      target="_blank">https://github.com/rmannibucau</a></i></div>
                                <div><br>
                                </div>
                              </div>
                              <br>
                              <br>
                              <div class="gmail_quote">2013/7/14 Mark
                                Struberg <span dir="ltr">&lt;<a
                                    moz-do-not-send="true"
                                    href="mailto:struberg@yahoo.de"
                                    target="_blank">struberg@yahoo.de</a>&gt;</span><br>
                                <blockquote class="gmail_quote"
                                  style="margin:0 0 0
                                  .8ex;border-left:1px #ccc
                                  solid;padding-left:1ex">
                                  folks, this breaks backward
                                  compatibility<br>
                                  <br>
                                  <br>
                                  In CDI 1.0 it was perfectly fine to do
                                  the following<br>
                                  <br>
                                      @Produces<br>
                                      @Dependent<br>
                                      public &lt;KEY, VALUE extends
                                  Serializable&gt; Cache&lt;KEY,
                                  VALUE&gt;
                                  getDefaultCache(InjectionPoint
                                  injectionPoint) {<br>
                                          Type ipType =
                                  injectionPoint.getType();<br>
                                          String cacheName = null;<br>
                                  <br>
                                          if (ipType instanceof
                                  ParameterizedType) {<br>
                                              ParameterizedType generic
                                  = (ParameterizedType) ipType;<br>
                                              Type[] paramTypes =
                                  generic.getActualTypeArguments();<br>
                                              if (paramTypes == null ||
                                  paramTypes.length != 2) {<br>
                                                  throw new
                                  RuntimeException("illegal param types
                                  for generic type " + ipType);<br>
                                              }<br>
                                  <br>
                                              if (paramTypes[1]
                                  instanceof Class) {<br>
                                                  cacheName = ((Class)
                                  paramTypes[1]).getSimpleName();<br>
                                              }<br>
                                              else {<br>
                                                  cacheName =
                                  paramTypes[1].toString();<br>
                                              }<br>
                                          }<br>
                                  <br>
                                          return getCache(cacheName);<br>
                                      }<br>
                                  <br>
                                  <br>
                                  <br>
                                  usage:<br>
                                  <br>
                                  <br>
                                  @Inject<br>
                                  private Cache&lt;String, IdmUser&gt;
                                  userCache;<br>
                                  <br>
                                  <br>
                                  With your new interpretation you
                                  basically trash this, right?<br>
                                  For having a generic producer you
                                  would need to create a distinct
                                  producer method for each and every
                                  usage. This just doesn't work out in
                                  practice...<br>
                                  <div><br>
                                    <br>
                                    <br>
                                    LieGrue,<br>
                                    strub<br>
                                    <br>
                                    <br>
                                    <br>
                                    <br>
                                    <br>
                                    ----- Original Message -----<br>
                                    From: Martin Kouba &lt;<a
                                      moz-do-not-send="true"
                                      href="mailto:mkouba@redhat.com"
                                      target="_blank">mkouba@redhat.com</a>&gt;<br>
                                  </div>
                                  <div>To: Arne Limburg &lt;<a
                                      moz-do-not-send="true"
                                      href="mailto:arne.limburg@openknowledge.de"
                                      target="_blank">arne.limburg@openknowledge.de</a>&gt;<br>
                                    Cc: "<a moz-do-not-send="true"
                                      href="mailto:cdi-dev@lists.jboss.org"
                                      target="_blank">cdi-dev@lists.jboss.org</a>"
                                    &lt;<a moz-do-not-send="true"
                                      href="mailto:cdi-dev@lists.jboss.org"
                                      target="_blank">cdi-dev@lists.jboss.org</a>&gt;<br>
                                    Sent: Wednesday, 10 July 2013, 14:01<br>
                                    Subject: Re: [cdi-dev] CDI and
                                    generics<br>
                                    <br>
                                  </div>
                                  <div>
                                    <div>No, it's not necessary. We'll
                                      fix this within CDITCK-349 [1].
                                      Leave a<br>
                                      comment if you wish :-)<br>
                                      <br>
                                      Thanks<br>
                                      Martin<br>
                                      <br>
                                      [1]<br>
                                      <a moz-do-not-send="true"
                                        href="https://issues.jboss.org/browse/CDITCK-349"
                                        target="_blank">https://issues.jboss.org/browse/CDITCK-349</a><br>
                                      <br>
                                      <br>
                                      Dne 10.7.2013 13:52, Arne Limburg
                                      napsal(a):<br>
                                      &gt; OK, so shall I create a TCK
                                      issue for that?<br>
                                      &gt;<br>
                                      &gt;<br>
                                      &gt; Cheers,<br>
                                      &gt; Arne<br>
                                      &gt;<br>
                                      &gt; Am 10.07.13 13:50 schrieb
                                      "Martin Kouba" unter &lt;<a
                                        moz-do-not-send="true"
                                        href="mailto:mkouba@redhat.com"
                                        target="_blank">mkouba@redhat.com</a>&gt;:<br>
                                      &gt;<br>
                                      &gt;&gt; Hi Arne,<br>
                                      &gt;&gt;<br>
                                      &gt;&gt; I think so (except the
                                      required type is
                                      Baz&lt;List&lt;Qux&gt;&gt;) -
                                      there is no<br>
                                      &gt;&gt; bean with assignable bean
                                      type for this IP (according to CDI
                                      1.1 rules<br>
                                      &gt;&gt; of course).<br>
                                      &gt;&gt;<br>
                                      &gt;&gt; Martin<br>
                                      &gt;&gt;<br>
                                      &gt;&gt; Dne 10.7.2013 13:16, Arne
                                      Limburg napsal(a):<br>
                                      &gt;&gt;&gt; Hi Martin,<br>
                                      &gt;&gt;&gt;<br>
                                      &gt;&gt;&gt; So, which bean should
                                      be injected into<br>
                                      &gt;&gt;&gt; @Inject<br>
                                      &gt;&gt;&gt;     private
                                      Baz&lt;List&lt;T2&gt;&gt;
                                      t2BazList;<br>
                                      &gt;&gt;&gt; ?<br>
                                      &gt;&gt;&gt;<br>
                                      &gt;&gt;&gt; Baz&lt;T&gt; is also
                                      not assignable to
                                      Baz&lt;List&lt;String&gt;&gt;,
                                      because List&lt;String&gt;<br>
                                      &gt;&gt;&gt; is also not
                                      assignable from Object.<br>
                                      &gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;<br>
                                      &gt;&gt;&gt; Am I right, that the
                                      test should throw an<br>
                                      &gt;&gt;&gt;
                                      UnsatisfiedResolutionException?<br>
                                      &gt;&gt;&gt;<br>
                                      &gt;&gt;&gt; Cheers,<br>
                                      &gt;&gt;&gt; Arne<br>
                                      &gt;&gt;&gt;<br>
                                      &gt;&gt;&gt; Am 08.07.13 12:17
                                      schrieb "Martin Kouba" unter &lt;<a
                                        moz-do-not-send="true"
                                        href="mailto:mkouba@redhat.com"
                                        target="_blank">mkouba@redhat.com</a>&gt;:<br>
                                      &gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt; Re Arne's
                                      question:<br>
                                      &gt;&gt;&gt;&gt; Yes, Baz is a
                                      managed bean and
                                      AmbiguousResolutionException
                                      should not<br>
                                      &gt;&gt;&gt;&gt; be thrown because
                                      Qux is not a managed bean (doesn't
                                      have a public<br>
                                      &gt;&gt;&gt;&gt; no-arg
                                      constructor).<br>
                                      &gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt; Re Marko's
                                      findings:<br>
                                      &gt;&gt;&gt;&gt; Yes, the TCK
                                      assertions are not up to date and
                                      Baz&lt;T&gt; is not assignable<br>
                                      &gt;&gt;&gt;&gt; to
                                      Baz&lt;String&gt;, because String
                                      is not assignable from Object (no
                                      bound<br>
                                      &gt;&gt;&gt;&gt; is defined -&gt;
                                      Object is assumed; see JSL 4.4).
                                      So I confirm a TCK<br>
                                      &gt;&gt;&gt;&gt; issue.<br>
                                      &gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt; IMO this would
                                      deserve a proper cleanup...<br>
                                      &gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt; Martin<br>
                                      &gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt; Dne 8.7.2013
                                      01:22, Marko Lukša napsal(a):<br>
                                      &gt;&gt;&gt;&gt;&gt; I'd say it's
                                      a bug. While Baz indeed is a
                                      managed bean, it shouldn't<br>
                                      &gt;&gt;&gt;&gt;&gt; be<br>
                                      &gt;&gt;&gt;&gt;&gt; injected into
                                      injection point with type
                                      Baz&lt;String&gt; nor<br>
                                      &gt;&gt;&gt;&gt;&gt;
                                      Baz&lt;List&lt;Qux&gt;&gt;.<br>
                                      &gt;&gt;&gt;&gt;&gt; So I believe
                                      you're right in saying that this
                                      test should fail with<br>
                                      &gt;&gt;&gt;&gt;&gt;
                                      UnsatisfiedResolutionException.<br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt; There was a
                                      change made to the spec way back
                                      in 2010 (see [1]), but<br>
                                      &gt;&gt;&gt;&gt;&gt; the<br>
                                      &gt;&gt;&gt;&gt;&gt; TCK
                                      apparently wasn't updated then.
                                      I've filed an issue in the TCK<br>
                                      &gt;&gt;&gt;&gt;&gt; jira<br>
                                      &gt;&gt;&gt;&gt;&gt; [2].<br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt; The problem
                                      isn't only in the TCK, but also in
                                      the spec itself. Some<br>
                                      &gt;&gt;&gt;&gt;&gt; of<br>
                                      &gt;&gt;&gt;&gt;&gt; the examples
                                      in section 5.2.4 don't conform to
                                      the rules defined in<br>
                                      &gt;&gt;&gt;&gt;&gt; the<br>
                                      &gt;&gt;&gt;&gt;&gt; same section
                                      (according to the rules, bean
                                      Dao&lt;T extends Persistent&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt; shouldn't be
                                      eligible for injection into
                                      Dao&lt;Order&gt; or
                                      Dao&lt;User&gt;). I<br>
                                      &gt;&gt;&gt;&gt;&gt; remember
                                      asking about this a year ago
                                      ([3]), but I didn't articulate<br>
                                      &gt;&gt;&gt;&gt;&gt; the<br>
                                      &gt;&gt;&gt;&gt;&gt; problem
                                      properly.<br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt; [1]<br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt; <a
                                        moz-do-not-send="true"
href="https://github.com/cdi-spec/cdi/commit/b32243350ace6a0bba337f91a35f5fd0"
                                        target="_blank">
https://github.com/cdi-spec/cdi/commit/b32243350ace6a0bba337f91a35f5fd0</a><br>
                                      &gt;&gt;&gt;&gt;&gt; 5c<br>
                                      &gt;&gt;&gt;&gt;&gt; 151f14<br>
                                      &gt;&gt;&gt;&gt;&gt; [2] <a
                                        moz-do-not-send="true"
                                        href="https://issues.jboss.org/browse/CDITCK-349"
                                        target="_blank">https://issues.jboss.org/browse/CDITCK-349</a><br>
                                      &gt;&gt;&gt;&gt;&gt; [3] <a
                                        moz-do-not-send="true"
                                        href="http://lists.jboss.org/pipermail/cdi-dev/2012-April/001742.html"
                                        target="_blank">
http://lists.jboss.org/pipermail/cdi-dev/2012-April/001742.html</a><br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt; Marko<br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt; On 7.7.2013
                                      16:04, Arne Limburg wrote:<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; Hi all,<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; At the
                                      OpenWebBeans list we are currently
                                      discussing handling of<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; generics
                                      in CDI.<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; I found a
                                      test in the CDI 1.1 TCK, which
                                      imho has a bug. The test<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; is<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;
                                      org.jboss.cdi.tck.tests.inheritance.generics.MemberLevelInheritanceTes<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; t<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; and the
                                      (simplified) deployment scenario
                                      is the following:<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; public
                                      class Baz&lt;T&gt; {<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; }<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; public
                                      class Qux extends
                                      Baz&lt;String&gt; {<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; }<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; @Vetoed<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; public
                                      class Bar&lt;T1, T2&gt; {<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   @Inject<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   private
                                      Baz&lt;T1&gt; baz;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   @Inject<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   private
                                      Baz&lt;List&lt;T2&gt;&gt;
                                      t2BazList;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; }<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;
                                      @RequestScoped<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; public
                                      class Foo extends Bar&lt;String,
                                      Qux&gt; {<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; }<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; public
                                      class Producer {<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; 
                                       @Produces<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; 
                                       @Amazing<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   public
                                      String produceString() {<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   
                                       return "ok";<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   }<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; 
                                       @Produces<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   public
                                      String[] produceStringArray() {<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   
                                       return new String[0];<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   }<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; 
                                       @Produces<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   public
                                      Baz&lt;Baz&lt;Qux&gt;&gt;
                                      produceBazBazQux() {<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   
                                       return new Baz();<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;   }<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; }<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; The class
                                      Bar has some more injection
                                      points, but that does not<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; matter.<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; Due to
                                      the TCK this deployment should
                                      work, but I don't know how.<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; Question:
                                      Is Baz a Bean (I suppose so) and
                                      may it be injected into<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; Bean Foo,
                                      more precisely into the second
                                      injection point of class<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; Bar?<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; - If yes,
                                      it also should be injected into
                                      the first injection<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; point,
                                      right? This would lead to an
                                      AmbiguousResolutionException<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; since<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; Qux may
                                      also be injected into the first
                                      injection point.<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; - If no,
                                      the deployment should fail with a<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;
                                      UnsatisfiedResolutionException
                                      since there is no Bean that can be<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; injected
                                      into that injection point.<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; Is this a
                                      bug in the TCK and if not, how is
                                      this supposed to work?<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; Cheers,<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; Arne<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt;
                                      _______________________________________________<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; cdi-dev
                                      mailing list<br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; <a
                                        moz-do-not-send="true"
                                        href="mailto:cdi-dev@lists.jboss.org"
                                        target="_blank">cdi-dev@lists.jboss.org</a><br>
                                      &gt;&gt;&gt;&gt;&gt;&gt; <a
                                        moz-do-not-send="true"
                                        href="https://lists.jboss.org/mailman/listinfo/cdi-dev"
                                        target="_blank">
https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;&gt;
                                      _______________________________________________<br>
                                      &gt;&gt;&gt;&gt;&gt; cdi-dev
                                      mailing list<br>
                                      &gt;&gt;&gt;&gt;&gt; <a
                                        moz-do-not-send="true"
                                        href="mailto:cdi-dev@lists.jboss.org"
                                        target="_blank">cdi-dev@lists.jboss.org</a><br>
                                      &gt;&gt;&gt;&gt;&gt; <a
                                        moz-do-not-send="true"
                                        href="https://lists.jboss.org/mailman/listinfo/cdi-dev"
                                        target="_blank">
https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
                                      &gt;&gt;&gt;&gt;&gt;<br>
                                      &gt;&gt;&gt;&gt;
                                      _______________________________________________<br>
                                      &gt;&gt;&gt;&gt; cdi-dev mailing
                                      list<br>
                                      &gt;&gt;&gt;&gt; <a
                                        moz-do-not-send="true"
                                        href="mailto:cdi-dev@lists.jboss.org"
                                        target="_blank">cdi-dev@lists.jboss.org</a><br>
                                      &gt;&gt;&gt;&gt; <a
                                        moz-do-not-send="true"
                                        href="https://lists.jboss.org/mailman/listinfo/cdi-dev"
                                        target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
                                      &gt;&gt;&gt;<br>
                                      &gt;<br>
                                      <br>
_______________________________________________<br>
                                      cdi-dev mailing list<br>
                                      <a moz-do-not-send="true"
                                        href="mailto:cdi-dev@lists.jboss.org"
                                        target="_blank">cdi-dev@lists.jboss.org</a><br>
                                      <a moz-do-not-send="true"
                                        href="https://lists.jboss.org/mailman/listinfo/cdi-dev"
                                        target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
                                      <br>
_______________________________________________<br>
                                      cdi-dev mailing list<br>
                                      <a moz-do-not-send="true"
                                        href="mailto:cdi-dev@lists.jboss.org"
                                        target="_blank">cdi-dev@lists.jboss.org</a><br>
                                      <a moz-do-not-send="true"
                                        href="https://lists.jboss.org/mailman/listinfo/cdi-dev"
                                        target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></div>
                                  </div>
                                </blockquote>
                              </div>
                              <br>
                            </div>
                          </div>
                        </div>
                      </div>
                    </span></div>
                </blockquote>
              </div>
              <br>
            </div>
          </div>
        </div>
      </span>
      <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>