I accept the need for the restriction - in fact that is what we did. I just wanted a fuller understanding of what was happening here
On 6 December 2012 14:52, Frank Pavageau <frank.pavag...@gmail.com> wrote: > 2012/12/6 James Cook <james.c...@plumbee.com> > >> after() throwing(MyRuntimeException ex) : call (* *(..)) >> > [...] > >> Is this down to how AspectJ inspects for which methods are eligible? In >> other words is this expected behaviour for RuntimeException child classes? >> Currently using 1.6.12 with Java 1.7_09. >> > > AFAIK, AspectJ does not inspect the methods to find if they are eligible, > it advises all the pointcuts that match. Especially in the case of a > RuntimeException, it has no way to know if such an exception might be > thrown in a method or in one of its called methods (and their called > methods, etc.). You're not limited to the origin method of the exception as > you don't always want to catch an exception right after the method where > it's initially thrown, and AspectJ covers all these cases. > > You need some way to restrict your pointcut. > > Frank >
_______________________________________________ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users