[weld-dev] Potential bug with Typed not affecting if a ProducerMethod is proxiable.
Benjamin Confino
BENJAMIC at uk.ibm.com
Tue Mar 13 06:05:19 EDT 2018
Thank you Matej that's good to know.
From: Matej Novotny <manovotn at redhat.com>
To: Benjamin Confino <BENJAMIC at uk.ibm.com>
Cc: weld-dev at lists.jboss.org, Emily Jiang <EMIJIANG at uk.ibm.com>
Date: 13/03/2018 09:36
Subject: Re: [weld-dev] Potential bug with Typed not affecting if a
ProducerMethod is proxiable.
Hi,
comments inline.
Matej
----- Original Message -----
> From: "Benjamin Confino" <BENJAMIC at uk.ibm.com>
> To: weld-dev at lists.jboss.org
> Cc: "Emily Jiang" <EMIJIANG at uk.ibm.com>
> Sent: Monday, March 12, 2018 6:40:27 PM
> Subject: [weld-dev] Potential bug with Typed not affecting if a
ProducerMethod is proxiable.
>
> Hello
>
> I can see something that might be a bug in weld. I attempted to work
> around
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=
by using
> the at Typed annotation on a Producer Method to exclude the unproxiable
Types
> and thus avoid getting caught by the failing isBeanProxiable check.
> However the annotation did not affect whether or not the ProducerMethod
is
> proxiable. This might be a second bug.
>
> I have uploaded a recreate application which I have verified against
> Wildfly 11.0.0 here:
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=
Thanks for reproducer, checking it now.
>
> To recreate you can download the pre-compiled binary from github, deploy
> it to a version of Wildfly without the fix for WELD-2466, and visit the
> url
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=
> this will trigger a call to getInjectableReference() which will fail
> because the ProducerMethod for recreate.BeanProducer.produceBean() is
not
> proxiable.
>
> If you debug into constructor for ProducerMethod at line 76 you will see
> that the proxiable flag is set using method.getTypeClosures() ; which
> returns all the associated types, rather than just those specified with
> the Typed() paramater.
>
> Is this the correct behaviour? Should a ProducerMethod be unproxiable
even
> with Typed limiting the bean types to proxiable types?
I think this is correct behaviour because:
* Weld needs to proxy whole class hierarchy, we cannot just skip one
underlying class when creating the proxy object
* @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
Therefore, @Typed is not really connected to proxyability but rather to
assignability of that produced bean to a given injection point.
I'll double check this but I really think it's correct behaviour.
>
> Regards
> Benjamin
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
>
> _______________________________________________
> weld-dev mailing list
> weld-dev at lists.jboss.org
>
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=
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20180313/f8e2672a/attachment-0001.html
More information about the weld-dev
mailing list