<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"> <br>
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN<br>
Phone: +44 (0)1962 816278 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:
</font><font size=1 face="sans-serif">John Ament <john.ament@spartasystems.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">cdi-dev <cdi-dev@lists.jboss.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">11/09/2016 20:04</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</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:
</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. 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"> @Produces</font>
<br><font size=3 face="Calibri"> @ApplicationScoped</font>
<br><font size=3 face="Calibri"> public Simpler makeSimpler()
{</font>
<br><font size=3 face="Calibri"> return new
Simpler("Boop");</font>
<br><font size=3 face="Calibri"> }</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"> @Override</font>
<br><font size=3 face="Calibri"> @Produces</font>
<br><font size=3 face="Calibri"> public Simpler makeSimpler()
{</font>
<br><font size=3 face="Calibri"> return new
Simpler("Boop2");</font>
<br><font size=3 face="Calibri"> }</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. 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>