Bug 113073 - weaveinfo messages not reported if applying declare @method on an ITD'd method
Summary: weaveinfo messages not reported if applying declare @method on an ITD'd method
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-19 09:24 EDT by Helen Beeken CLA
Modified: 2012-04-03 15:51 EDT (History)
0 users

See Also:


Attachments
patch containing testcase (2.79 KB, patch)
2005-10-19 10:12 EDT, Helen Beeken CLA
no flags Details | Diff
patch containing fix (18.21 KB, patch)
2005-10-19 10:13 EDT, Helen Beeken CLA
no flags Details | Diff
patch containing Improved testcase (3.05 KB, patch)
2005-10-20 03:54 EDT, Helen Beeken CLA
aclement: iplog+
Details | Diff
patch containing fix (2.71 KB, patch)
2005-10-20 06:39 EDT, Helen Beeken CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helen Beeken CLA 2005-10-19 09:24:26 EDT
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.
Comment 1 Helen Beeken CLA 2005-10-19 10:04:04 EDT
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.
Comment 2 Helen Beeken CLA 2005-10-19 10:12:33 EDT
Created attachment 28442 [details]
patch containing testcase

Apply this patch to the tests project.
Comment 3 Helen Beeken CLA 2005-10-19 10:13:09 EDT
Created attachment 28443 [details]
patch containing fix

Apply this patch to the weaver project
Comment 4 Helen Beeken CLA 2005-10-20 03:54:08 EDT
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.
Comment 5 Helen Beeken CLA 2005-10-20 06:39:45 EDT
Created attachment 28509 [details]
patch containing fix
Comment 6 Andrew Clement CLA 2005-10-20 09:55:29 EDT
test and variant of patch committed. thanks helen.

will close bug when build available.
Comment 7 Andrew Clement CLA 2005-10-21 03:03:02 EDT
build available.