<font size=2 face="sans-serif">Thank you Matej that's good to know. </font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Matej Novotny <manovotn@redhat.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">Benjamin Confino <BENJAMIC@uk.ibm.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">weld-dev@lists.jboss.org,
Emily Jiang <EMIJIANG@uk.ibm.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">13/03/2018 09:36</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: [weld-dev]
Potential bug with Typed not affecting if a ProducerMethod
is proxiable.</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Hi,<br>
<br>
comments inline.<br>
<br>
Matej<br>
<br>
----- Original Message -----<br>
> From: "Benjamin Confino" <BENJAMIC@uk.ibm.com><br>
> To: weld-dev@lists.jboss.org<br>
> Cc: "Emily Jiang" <EMIJIANG@uk.ibm.com><br>
> Sent: Monday, March 12, 2018 6:40:27 PM<br>
> Subject: [weld-dev] Potential bug with Typed not affecting if a
ProducerMethod
is proxiable.<br>
> <br>
> Hello<br>
> <br>
> I can see something that might be a bug in weld. I attempted to work<br>
> around </font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__issues.jboss.org_projects_WELD_issues_WELD-2D2466&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=hl8XiFr1UrTSgyXVc4KO_i51sM3Gyhlu1KZ4TkyseEQ&m=ScbAGiokKoG8J7UIq97SogIlYzc6sVEtHpdb4KOqFw8&s=Tv24CjpIwcNluyXRoaRewFcbDniYgUcUn6thtVXNjwY&e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=https-3A__issues.jboss.org_projects_WELD_issues_WELD-2D2466&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=hl8XiFr1UrTSgyXVc4KO_i51sM3Gyhlu1KZ4TkyseEQ&m=ScbAGiokKoG8J7UIq97SogIlYzc6sVEtHpdb4KOqFw8&s=Tv24CjpIwcNluyXRoaRewFcbDniYgUcUn6thtVXNjwY&e=</font></tt></a><tt><font size=2>
by using<br>
> the@Typed annotation on a Producer Method to exclude the unproxiable
Types<br>
> and thus avoid getting caught by the failing isBeanProxiable check.<br>
> However the annotation did not affect whether or not the ProducerMethod
is<br>
> proxiable. This might be a second bug.<br>
> <br>
> I have uploaded a recreate application which I have verified against<br>
> Wildfly 11.0.0 here: </font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_benjamin-2Dconfino_TypedProducerBug&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=hl8XiFr1UrTSgyXVc4KO_i51sM3Gyhlu1KZ4TkyseEQ&m=ScbAGiokKoG8J7UIq97SogIlYzc6sVEtHpdb4KOqFw8&s=7eRe_h7ECCu90QwZkeL2f8vjrGk8-Ky3F6KKRI9eroI&e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_benjamin-2Dconfino_TypedProducerBug&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=hl8XiFr1UrTSgyXVc4KO_i51sM3Gyhlu1KZ4TkyseEQ&m=ScbAGiokKoG8J7UIq97SogIlYzc6sVEtHpdb4KOqFw8&s=7eRe_h7ECCu90QwZkeL2f8vjrGk8-Ky3F6KKRI9eroI&e=</font></tt></a><tt><font size=2><br>
<br>
Thanks for reproducer, checking it now.<br>
<br>
> <br>
> To recreate you can download the pre-compiled binary from github,
deploy<br>
> it to a version of Wildfly without the fix for WELD-2466, and visit
the<br>
> url </font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A8080_WeldRecreateProducesExtendedAbstract_inheritance&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=hl8XiFr1UrTSgyXVc4KO_i51sM3Gyhlu1KZ4TkyseEQ&m=ScbAGiokKoG8J7UIq97SogIlYzc6sVEtHpdb4KOqFw8&s=UBmyUqqsPVaalvwahMH_dEjkrRsQcwOheatneSMHVNQ&e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A8080_WeldRecreateProducesExtendedAbstract_inheritance&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=hl8XiFr1UrTSgyXVc4KO_i51sM3Gyhlu1KZ4TkyseEQ&m=ScbAGiokKoG8J7UIq97SogIlYzc6sVEtHpdb4KOqFw8&s=UBmyUqqsPVaalvwahMH_dEjkrRsQcwOheatneSMHVNQ&e=</font></tt></a><tt><font size=2><br>
> this will trigger a call to getInjectableReference() which will fail<br>
> because the ProducerMethod for recreate.BeanProducer.produceBean()
is not<br>
> proxiable.<br>
> <br>
> If you debug into constructor for ProducerMethod at line 76 you will
see<br>
> that the proxiable flag is set using method.getTypeClosures() ; which<br>
> returns all the associated types, rather than just those specified
with<br>
> the Typed() paramater.<br>
> <br>
> Is this the correct behaviour? Should a ProducerMethod be unproxiable
even<br>
> with Typed limiting the bean types to proxiable types?<br>
<br>
I think this is correct behaviour because:<br>
* Weld needs to proxy whole class hierarchy, we cannot just skip one underlying
class when creating the proxy object<br>
* @Typed is then used to determine where can this bean be injected, e.g.
which bean types are used to match it against required types of each injection
point<br>
<br>
Therefore, @Typed is not really connected to proxyability but rather to
assignability of that produced bean to a given injection point.<br>
<br>
I'll double check this but I really think it's correct behaviour.<br>
<br>
> <br>
> Regards<br>
> Benjamin<br>
> Unless stated otherwise above:<br>
> IBM United Kingdom Limited - Registered in England and Wales with
number<br>
> 741598.<br>
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU<br>
> <br>
> _______________________________________________<br>
> weld-dev mailing list<br>
> weld-dev@lists.jboss.org<br>
> </font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.jboss.org_mailman_listinfo_weld-2Ddev&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=hl8XiFr1UrTSgyXVc4KO_i51sM3Gyhlu1KZ4TkyseEQ&m=ScbAGiokKoG8J7UIq97SogIlYzc6sVEtHpdb4KOqFw8&s=zfPYGJTeMlNEu9b6uzEuu9Jh5DudVi-PdbzlGSY0EAg&e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.jboss.org_mailman_listinfo_weld-2Ddev&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=hl8XiFr1UrTSgyXVc4KO_i51sM3Gyhlu1KZ4TkyseEQ&m=ScbAGiokKoG8J7UIq97SogIlYzc6sVEtHpdb4KOqFw8&s=zfPYGJTeMlNEu9b6uzEuu9Jh5DudVi-PdbzlGSY0EAg&e=</font></tt></a><tt><font size=2><br>
<br>
</font></tt>
<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>