Community
Participate
Working Groups
Created attachment 175388 [details] test case for the bug See attachment for a testcase. Result shows the advice was not applied. $ ajc -1.5 *.java *.aj bug/A.aj:8 [warning] advice defined in A has not been applied [Xlint:adviceDidNotMatch] 1 warning Note that the annotation is marked @Inherited and thus should be part of class C. This is verified by inspecting the generated classfile, so ajc simply fails to match it. Perhaps the advice is matched prior to the introduction?
i'm afraid that according to the rules of Java annotation inheritance, annotations are not inherited through interfaces, they are only inherited through superclasses. Since you have annotated an interface, C does not inherit it.
Very interesting, I was not aware of those semantics. I thought I had inherited an annotation and advised it in another use case, but apparently that case was advising an interface call (and thus, no inheriting). Sorry for the mistake and thank you for clarifying!