Qi4j.dereference() does not work inside Concerns/SideEffects, if Concern added 
withConcerns() in bootstrap.
-----------------------------------------------------------------------------------------------------------

                 Key: QI-230
                 URL: http://issues.ops4j.org/browse/QI-230
             Project: Qi4j
          Issue Type: Bug
            Reporter: Niclas Hedhman
            Assignee: Rickard Öberg



If I add a Concern with ServiceDeclaration.withConcerns() and dereferences the 
Composite pointer inside that Concern with Qi4j.dereference(), then a 
ClassCastException happens on the following line;

class Qi4jRuntimeImpl

{code:java}
    public <T> T dereference( T composite )
    {
        InvocationHandler handler = getInvocationHandler( composite );
        if( handler instanceof ProxyReferenceInvocationHandler )
        {
            return (T) ( (ProxyReferenceInvocationHandler) handler ).proxy();  
<--- HERE
        }
        if( handler instanceof CompositeInstance )
        {
            return composite;
        }
        return null;
    }
{code}

Because the ProxyReferenceInvocationHandler.proxy is not a Composite, but a 
$Proxy that can not be cast to a Composite.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to