• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AspectJ MethodSignature Returns Null Method

 
Jeff Storey
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I'm relatively new to AspectJ (used in the past, but not for a while, so I'm a little bit rusty). I've setup a pointcut to catch all method calls, which it does, and then in the advice, I'm trying to print out the actual method that was called. I can do that using the following: thisJoinPoint.getSignature().toString() and that works just fine. However, I'm trying to get the underlying Method object, with thisJoinPoint.getSignature().getMethod(), and the method sometimes returns null when the signature is not null. Can anyone explain why this is happening?

Thanks,
Jeff
 
Timo Meinen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get the Method by



I have the same problem when the method is inherited from a superclass. Then the method is null. It's strange, because using the same technique with fields works just fine with inherited fields.

Did you find a solution for the problem?

There is a bug on eclipse for this purpose: https://bugs.eclipse.org/bugs/show_bug.cgi?id=154427

Thank you. Timo
timomeinen@gmail.com

[ October 24, 2007: Message edited by: Timo Meinen ]
[ October 24, 2007: Message edited by: Timo Meinen ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic