mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-18 02:11:48 +02:00
28 lines
605 B
Java
28 lines
605 B
Java
![]() |
import org.aspectj.lang.*;
|
||
|
|
||
|
public class AfterThrowingAdviceSyntaxError {
|
||
|
|
||
|
public static void main(String[] args) {
|
||
|
perform();
|
||
|
}
|
||
|
|
||
|
private static void perform() {
|
||
|
Object nullObj = null;
|
||
|
nullObj.toString();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
aspect ExceptionLoggerAspectV2
|
||
|
{
|
||
|
|
||
|
pointcut exceptionLogMethods()
|
||
|
: call(* *.*(..)) && !within(ExceptionLoggerAspectV2);
|
||
|
|
||
|
after() thowing(Throwable ex) : exceptionLogMethods() {
|
||
|
Signature sig = thisJoinPointStaticPart.getSignature();
|
||
|
System.out.printl("WARNING: "
|
||
|
+ sig.getDeclaringType().getName() + " "
|
||
|
+ sig.getName() + " "
|
||
|
+ "Exception logger aspect " + ex);
|
||
|
}
|
||
|
}
|