<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Emily,</p>
<p><br>
</p>
<p>I disagree, at least it doesn't add any new ambiguous injections. &nbsp;The use-case is specifically to Specialized/Alternative beans. &nbsp;Right now inheritance of managed beans is itself problematic, as injecting the base class can cause these ambiguous resolutions.</p>
<p><br>
</p>
<p>The example I sent out actually works correctly (in weld at least), really my propose is to remove the need to have Produces a second time and update the spec to clarify what happens here (FWIW, I don't believe the case is currently described in the spec),
 hopefully to say that qualifiers and scopes from the base method remain in effect, unless explicitly overridden.</p>
<p><br>
</p>
<p>John</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Emily Jiang &lt;EMIJIANG@uk.ibm.com&gt;<br>
<b>Sent:</b> Sunday, September 11, 2016 5:59 PM<br>
<b>To:</b> John Ament<br>
<b>Cc:</b> cdi-dev<br>
<b>Subject:</b> Re: [cdi-dev] Should javax.enterprise.inject.Produces be inherited?</font>
<div>&nbsp;</div>
</div>
<div><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;&#43;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>
<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>
<p></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" id="LPlnk434075"><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>
<div id="LPBorder_GT_14736344063510.4667449452313208" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14736344063480.6304374319906678" cellspacing="0" style="width: 90%; position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200); background-color: rgb(255, 255, 255);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14736344063490.5909000146217864" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14736344063490.22326955554182648"></div>
<div id="LPTitle_14736344063490.19371550317806618" style="top: 0px; color: rgb(227, 30, 37); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, &quot;Segoe UI Light&quot;, &quot;Segoe WP Light&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14736344063500.531803315605305" href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank" style="text-decoration: none;">cdi-dev Info Page - JBoss Developer</a></div>
<div id="LPMetadata_14736344063500.9182799402134392" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.jboss.org</div>
<div id="LPDescription_14736344063500.7469706969316012" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
List to discuss the development of CDI (the specification) To see the collection of prior postings to the list, visit the cdi-dev Archives.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<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></div>
</div>
</div>
<hr>
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.
</body>
</html>