<font size=2 face="sans-serif">I think this is very problematic as you
will get AmbiguousResolutionException all the time once we introduce this
inheritance.</font>
<br>
<br><font size=2 face="sans-serif">Many thanks,<br>
Emily<br>
===========================<br>
Emily Jiang<br>
WebSphere Application Server, CDI Development Lead</font>
<br><font size=2 face="sans-serif">&nbsp;<br>
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN<br>
Phone: &nbsp;+44 (0)1962 816278 &nbsp;Internal: 246278<br>
<br>
Email: emijiang@uk.ibm.com <br>
Lotus Notes: Emily Jiang/UK/IBM@IBMGB<br>
</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">John Ament &lt;john.ament@spartasystems.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">cdi-dev &lt;cdi-dev@lists.jboss.org&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">11/09/2016 20:04</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">[cdi-dev] Should
javax.enterprise.inject.Produces be inherited?</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">cdi-dev-bounces@lists.jboss.org</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=3 face="Calibri">All,</font>
<br>
<br><font size=3 face="Calibri">I was just thinking about alternatives
and producer methods. &nbsp;Suppose I have the following bean:</font>
<br>
<p><font size=3 face="Calibri">@ApplicationScoped</font>
<br><font size=3 face="Calibri">public class Boop {</font>
<br>
<br><font size=3 face="Calibri">&nbsp; &nbsp; @Produces</font>
<br><font size=3 face="Calibri">&nbsp; &nbsp; @ApplicationScoped</font>
<br><font size=3 face="Calibri">&nbsp; &nbsp; public Simpler makeSimpler()
{</font>
<br><font size=3 face="Calibri">&nbsp; &nbsp; &nbsp; &nbsp; return new
Simpler(&quot;Boop&quot;);</font>
<br><font size=3 face="Calibri">&nbsp; &nbsp; }</font>
<br><font size=3 face="Calibri">}</font>
<br>
<br><font size=3 face="Calibri">If I want to override the producer method,
I need to declare fully:</font>
<br>
<p><font size=3 face="Calibri">@Alternative</font>
<br><font size=3 face="Calibri">@Priority(100)</font>
<br><font size=3 face="Calibri">@ApplicationScoped</font>
<br><font size=3 face="Calibri">public class BoopAlternative extends Boop{</font>
<br><font size=3 face="Calibri">&nbsp; &nbsp; @Override</font>
<br><font size=3 face="Calibri">&nbsp; &nbsp; @Produces</font>
<br><font size=3 face="Calibri">&nbsp; &nbsp; public Simpler makeSimpler()
{</font>
<br><font size=3 face="Calibri">&nbsp; &nbsp; &nbsp; &nbsp; return new
Simpler(&quot;Boop2&quot;);</font>
<br><font size=3 face="Calibri">&nbsp; &nbsp; }</font>
<br><font size=3 face="Calibri">}</font>
<br>
<br><font size=3 face="Calibri">For some reason, scopes are inherited,
but the produces annotation is not. &nbsp;At least in the case of a producer
method, it seems like it would be useful for @Produces to be inherited
as well.</font>
<br>
<br><font size=3 face="Calibri">John</font>
<br>
<p>
<hr><font size=3>NOTICE: This e-mail message and any attachments may contain
confidential, proprietary, and/or privileged information which should be
treated accordingly. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this message, and destroy
all physical and electronic copies. Thank you. </font><tt><font size=2>_______________________________________________<br>
cdi-dev mailing list<br>
cdi-dev@lists.jboss.org<br>
</font></tt><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/cdi-dev</font></tt></a><tt><font size=2><br>
<br>
Note that for all code provided on this list, the provider licenses the
code under the Apache License, Version 2 (</font></tt><a href="http://www.apache.org/licenses/LICENSE-2.0.html"><tt><font size=2>http://www.apache.org/licenses/LICENSE-2.0.html</font></tt></a><tt><font size=2>).
For all other ideas provided on this list, the provider waives all patent
and other intellectual property rights inherent in such information.</font></tt>
<br><font size=2 face="sans-serif"><br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>