Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] pointcut for super.*(..)

Oh. I don't know how to do that.

dean

On Mar 25, 2009, at 10:35 AM, Alejandro Garcia wrote:

Hello Dean,

Thank you very much for your response but I forgot to mention that what I really need is to capture super.*(..), translated to bytecode would be the line where we have "invokespecial   #??; //Method X.x:()V" where I don't care who's X or x. This would be a generalization of any call site where we have a super.*(..);
I apologize for previously not correctly explain myself.

Any other idea? Again thank you for your answer, actually it help me realize another issue. :)


On Mar 25, 2009, at 4:09 PM, Dean Wampler wrote:

Off the top of my head (not compiled and probably not the best way!), this pointcut should work:

call(void A.a()) && withincode(void B.a())

For the more general case, where you only know about "A" and you want to handle any subclass:

call(void A.a()) && withincode(void A+.a())

Not perfect; it would match on A.a if it's a recursive function. So,

call(void A.a()) && withincode(void A+.a()) && ! withincode(void A.a())

dean

On Mar 25, 2009, at 9:52 AM, Alejandro Garcia wrote:

Hello,

I need to capture a  super method call, any idea how or if it is possible?
Example:

class A { void a(){} }

class B extends A {void a(){super.a();}}

Thank you for any help, 
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Dean Wampler, Ph.D.
co-author: "Programming Scala", O'Reilly

twitter: @deanwampler, @chicagoscala
See also:
http://www.polyglotprogramming.com  Multi-language and multi-paradigm programming
http://www.aspectprogramming.com    AOP advocacy site
http://aquarium.rubyforge.org       AOP for Ruby
http://www.contract4j.org           Design by Contract for Java5

I want my tombstone to say:
  Unknown Application Error in Dean Wampler.exe.
  Application Terminated.
      [Okay]        [Cancel]







<ATT00001.txt>


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Dean Wampler, Ph.D.
co-author: "Programming Scala", O'Reilly

twitter: @deanwampler, @chicagoscala
See also:
http://www.polyglotprogramming.com  Multi-language and multi-paradigm programming
http://www.aspectprogramming.com    AOP advocacy site
http://aquarium.rubyforge.org       AOP for Ruby
http://www.contract4j.org           Design by Contract for Java5

I want my tombstone to say:
  Unknown Application Error in Dean Wampler.exe.
  Application Terminated.
      [Okay]        [Cancel]








Back to the top