[jboss-jira] [JBoss JIRA] Closed: (JBAOP-243) ${instanceof} disregards method call target
Kabir Khan (JIRA)
jira-events at lists.jboss.org
Thu Jun 21 08:50:52 EDT 2007
[ http://jira.jboss.com/jira/browse/JBAOP-243?page=all ]
Kabir Khan closed JBAOP-243.
----------------------------
Fix Version/s: (was: 2.0.0.alpha6)
Resolution: Done
Having looked at it I'm afraid this does not seem possible. Another option would have been to use the MethodCall.classname instead of calledMethod.getDeclaringClass(), but that is not definite, In the following:
Driver d = new Driver();
d.superMethod();
MethodName.classname returns "Driver", but in the following it returns "SuperInterface"
Object o = new Driver();
((SuperInterface)o).superMethod();
So, keeping the matching as it is we do not pick up the case mentioned here. If changing it as outlined above we do not pick up simpler cases. I don't want to match twice at this stage unless required by more users/customers since it will slow down the matching, since with the "new way" mentioned here we will have to load up the CtClass as well...
> ${instanceof} disregards method call target
> -------------------------------------------
>
> Key: JBAOP-243
> URL: http://jira.jboss.com/jira/browse/JBAOP-243
> Project: JBoss AOP
> Issue Type: Bug
> Affects Versions: 1.3.5
> Reporter: Konstantin Sobolev
> Assigned To: Kabir Khan
> Attachments: jbaop-243.tar.gz
>
>
> instanceof{$I}->method() checks a class declaring method() instead of the class on which this method is actually called.
> Example:
> interface I1 {void foo();}
> interface I2 {void bar();}
> class I1Impl implements I1 {void foo(){};}
> class Target extends I1Impl implements I2 {void bar();}
> now $instanceof{I1}->foo() will intercept new Target.foo(), while
> ${instanceof{I1}->bar() won't intercept new Target.bar().
> Testcase implementing this example is attached.
> Please see forum thread for a real life example.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list