While playing around with native AspectJ in IntelliJ I noticed something strange: An advice is not executed if I don't have the import(s) of the class(es) that I use in the corresponding pointcut. For example, assume the following pointcut:
public pointcut changeObject():
call(void MyObject.change());
The execution of the advice now depends on the fact whether I have an import statement of MyObject or not. If it's not present, it compiles without errors but I get the message: "Warning:(8, 0) ajc: no match for this type name: MyObject [Xlint:invalidAbsoluteTypeName]"
In this tutorial they do not need imports (IntelliJ also marks the import as unnecessary). So I'm wondering what the problem is.
My setup: IntelliJ Ultimate 2017.1 with enabled AspectJ plugin. I installed AspectJ 1.8.10 and referenced the Ajc compiler in the compiler settings of the IDE. In the projects structure I referenced aspectjrt.jar in "Modules | Dependencies".
Do I miss anything or could it be related to the fact that Intellij has not the best AspectJ support?