[ 
https://issues.apache.org/jira/browse/OWB-458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Struberg resolved OWB-458.
-------------------------------

       Resolution: Won't Fix
    Fix Version/s:     (was: 1.2.0)

as discussed on the EG, there is no way to implement equals in a meaningful 
ways for proxies.
                
> we should unpack the parameter for proxied equals(Object) calls in certain 
> cases
> --------------------------------------------------------------------------------
>
>                 Key: OWB-458
>                 URL: https://issues.apache.org/jira/browse/OWB-458
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Interceptor and Decorators
>    Affects Versions: 1.0.0-alpha-2
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>
> The problem:
> If you invoke an equals(Object o) method on a proxy, then the proxy might 
> directly access private fields if o is of the same type as the proxied object 
> itself.
> But if the proxy directly accesses private fields, then no interception 
> occurs and the equals method will effectively only get the empty values from 
> proxy itself (which enhances o's class and thus has the exact same fields).
> The solution:
> We need to 'unpack' the proxy parameter and instead provide the underlying 
> contextual instance
> if (inteceptedMethod.equals("equals") && param.intanceOf(bean.getType()) && 
> isOurProxy(parram)
> {
>   unpackedParam = 
> getUnderlyingContextualInstance((NormalScopedBeanInterceptor) param);
>   invoke("equals", unpackedParam);
> }
> ..

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to