[
http://issues.ops4j.org/browse/QI-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290#action_13290
]
Niclas Hedhman commented on QI-230:
-----------------------------------
I took out an incorrect comment.
Instead;
For the working case;
"composite" and "handler.proxy()" is of the same proxy class (in my case
$Proxy16)
For the non-working case, they are of different types (in my case $Proxy16 and
$Proxy18) but both refers to the same ServiceInstance as the handler.
> 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
> Fix For: 1.0
>
>
> 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