How to solve a “cannot find symbol variable thisJoinPoint” while trying to build an AspectJ project in AndroidStudio using annotation style?
Platform details: AspectJ 1.8.1, AndroidStudio 2.1.3
Code Example:
import org.aspectj.lang.JoinPoint.*; // Not used!
import org.aspectj.lang.ProceedingJoinPoint; // Not used!
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class MyAspect {
@Pointcut( "execution(* *(..))" )
public void methodExecution() {}
@After( "methodExecution()" )
public void accessThisJoinPointData() {
if ( thisJointPoint != null ) { // HERE the variable isn’t recognized!
// Do something with thisJoinPoint...
}
}
}