Summary: | Problem in abstract @AfterThrowing advice | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Alexander Kriegisch <Alexander> |
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | aclement |
Version: | 1.8.9 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 10 | ||
Whiteboard: |
Description
Alexander Kriegisch
2016-09-18 08:05:39 EDT
I am confused because the last parameter of this advice - *is* named 'exception' and - *is* of a subtype of Throwable I don't imagine the code that checks that hasn't a clue about generics, but taking a deeper look now. Actually it looks like it is because there is no local variable table attached to the abstract method so it comes up with a default name of 'arg' which doesn't meet expectations. Well I didn't know that, or I've forgotten it. Add the argNames="a,b,c" value to the annotation when there cannot be a local variable table (which occurs for abstract methods and non default interface methods). @AfterThrowing( pointcut = "execution(* com.myapp.*.facade.*.*(..))", throwing = "exception", argNames="exception" ) I think this was written before -parameters, which would be another option but needs some code writing in AspectJ to support it. I don't like the duplication, but at least it works. |