Bug 321107 - Advice does not match type annotations on introduced types
Summary: Advice does not match type annotations on introduced types
Status: CLOSED INVALID
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.9   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-28 06:55 EDT by Robert Dyer CLA
Modified: 2010-07-28 14:20 EDT (History)
1 user (show)

See Also:


Attachments
test case for the bug (921 bytes, application/zip)
2010-07-28 06:55 EDT, Robert Dyer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Dyer CLA 2010-07-28 06:55:32 EDT
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?
Comment 1 Andrew Clement CLA 2010-07-28 10:17:55 EDT
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.
Comment 2 Robert Dyer CLA 2010-07-28 14:20:28 EDT
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!