Community
Participate
Working Groups
Given the following class: @interface Annotation{} aspect B { declare @method : public * C.anotherMethod(..) : @Annotation; } class C { } aspect D { public void C.anotherMethod(String s) { } public void C.anotherMethod() { } } I would expect a two weaveinfo messages of the form: weaveinfo 'public void C.anotherMethod()' (pr99191_4.java) is annotated with @Annotation method annotation from 'B' (pr99191_4.java:3) weaveinfo 'public void C.anotherMethod(String)' (pr99191_4.java) is annotated with @Annotation method annotation from 'B' (pr99191_4.java:3) However, only the two "intertyped" messages are coming out.
The problem is that the BcelClassWeaver.reportMethodCtorWeavingMessage(..) is being called from within BcelClassWeaver.weaveDeclareAtMethodCtor(..) if the method matches. However, the possible methods to match against don't include the intertype methods. The reason this is only showing up for 'declare @method' and not 'declare @field' is that the list of possible fields does include the interype fields.
Created attachment 28442 [details] patch containing testcase Apply this patch to the tests project.
Created attachment 28443 [details] patch containing fix Apply this patch to the weaver project
Created attachment 28502 [details] patch containing Improved testcase This patch should be applied to the tests project. It includes an improved testcase which also tests the weaveinfo messages from a declare @contructor where the constructor is declared through an ITD. The fix doesn't need to be changed because declare @constructor uses the same logic as the declare @method.
Created attachment 28509 [details] patch containing fix
test and variant of patch committed. thanks helen. will close bug when build available.
build available.