[weld-dev] Is my class a proxy?

Bill Burke bburke at redhat.com
Tue Oct 29 09:57:24 EDT 2013


Can you point me to this code Emmanuel?  Right now, I'm just doing:

if (class.getName().contains("WeldClientProxy")) {}

Not sure how reliable that is.  I want something that is not binary 
dependent.

But, IMO, I just don't see any reason why proxy generator couldn't be fixed.

On 10/29/2013 9:53 AM, Emmanuel Bernard wrote:
> We had the same problem in Hibernate Validator and had to make special
> code to detect Weld proxies. A portable solution would be nice.
>
> On Tue 2013-10-29  9:29, Bill Burke wrote:
>> Hey all,
>>
>> CDI proxies lose generic type information which screws up Resteasy:
>>
>> https://issues.jboss.org/browse/RESTEASY-985
>>
>> Basically, in the bug, an injected bean's method is losing parameter
>> type information.  Can you either:
>>
>> a) Fix weld proxies so that generic type information is not lost (in
>> this case, it is method parameter type information). *Preferred*
>>
>> b) Have a supported way going forward to determine if the class is a CDI
>> proxy.  A marker interface or an annotation added to the proxy class
>> would be best, then I wouldn't need to have a binary dependency on Weld
>> and could do this via reflect calls.
>>
>> --
>> Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com
>> _______________________________________________
>> weld-dev mailing list
>> weld-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/weld-dev

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com


More information about the weld-dev mailing list