I had a further thought about this problem whilst out on a run, I can imagine (although I haven't coded it up) something around and if() clause and using reflection with <target>.class.getDeclaredMethod(<thisJoinPoint stuff in here>) (and walking up the hierarchy) to check where the method is actually declared. Won't do much for the performance though :)
> As for Signature.getDeclaringTypeName(), the acceptance criteria do not seem to involve dynamic method resolution, only static code analysis (what is the target's declared type?). Would it be possible to enhance that method, add a toggle or similarly named method for dynamic resolution?
Currently that information is built based solely on the invoke instruction (static info), we're not actually looking at what is on the stack so are at the mercy of what the compiler decided to do. It is feasible to add a similar named method but isn't that just the same as asking thisJoinPoint.getTarget().getClass() (at least for non static methods)?
cheers,
Andy