AfterReturning « Exception « Spring Q&A

1. Why is @AfterReturning only executed after @AfterThrowing on exception?

I have the following:

public void afterReturningFromTrustedMethodExecution() { ... }

@AfterThrowing(pointcut = "executionOfTrustedAnnotatedMethod()")
public void afterThrowingByExecutionOfTrustedAnnotatedMethod() { ... }
And Im observing this behaviour which does not make sense to me:
  • If the method captured by ...

2. AfterReturning advice executing after exception?

AfterReturning advice executing after exception? Ok, according to the documentation After returning advice runs when a matched method execution returns normally. It is declared using the AfterReturning annotation: So, I've got ...