<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>The attached project (maven and intellij) exhibits the problem with private observer methods when an App scoped bean is decorated.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>You can rung it from IJ, or from the command line using: <span style='font-size:8.0pt;font-family:"Lucida Console"'>mvn compile exec:java -Dexec.mainClass=Main<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>As delivered, you should see output like the following:<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'>doSomething decorator, <a href="mailto:delegate=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58">delegate=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>doSomething, <a href="mailto:this=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58">this=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58</a>, anInt=5<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Got event,&nbsp;&nbsp; <a href="mailto:this=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_Weld$Proxy$@49139829">this=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_Weld$Proxy$@49139829</a> &lt;= should be org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Got event,&nbsp;&nbsp; anInt=0 &lt;= should be 5<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Note the &#8220;anInt=0&#8221; where it should be 5.&nbsp; If you change AppScopeBean#observer from &#8216;private&#8217; to &#8216;protected&#8217; you will see output like this:<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'>doSomething decorator, <a href="mailto:delegate=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58">delegate=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>doSomething, <a href="mailto:this=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58">this=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58</a>, anInt=5<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Got event,&nbsp;&nbsp; <a href="mailto:this=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58">this=org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass@4550bb58</a> &lt;= should be org.jboss.weld.proxies.AppScopeBean$Proxy$_$$_WeldSubclass<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Got event,&nbsp;&nbsp; anInt=5 &lt;= should be 5<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Note that in the latter case, the member variable is properly initialized.&nbsp; The problem stems from the fact that the proxy implementation doesn&#8217;t include the private methods.&nbsp; I think that the changes included in <a href="https://issues.jboss.org/browse/WELD-2092">https://issues.jboss.org/browse/WELD-2092</a> have broken decorated beans with private observer methods. It also hinders tests that use things like JMockit Deencapsulation to invoke private methods on bean instances.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I don&#8217;t know how this all reconciles with the CDI spec, but the current implementation seems broken if I can&#8217;t have a private observer method simply because the class is the target of a Decorator.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thanks for taking the time to review this post.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Larry.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>