Bug 157057 - Pointcut not matching Annotated static field
Summary: Pointcut not matching Annotated static field
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.3   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-12 12:01 EDT by John D. Heintz CLA
Modified: 2006-09-21 17:29 EDT (History)
1 user (show)

See Also:


Attachments
cut-down testcase (4.31 KB, application/octet-stream)
2006-09-14 06:19 EDT, Matt Chapman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John D. Heintz CLA 2006-09-12 12:01:12 EDT
Advice on the following pointcut doesn't reliably match in a project I am working on.
 get(@Obtain static * *);

Frustratingly small changes will "fix" this: moving a matching class from tests to src, cutting out chunks of generics code to shrink the sample, ...

Because of how sensitive this bug is I've been unable to produce a standalone example so I've only got a reference to the actual project.

The environment I'm using is:
* Eclipse 3.2
* ADJT 1.4.1.200609121012
* Subclipse for Subversion access from http://subclipse.tigris.org/update_1.0.x

The project in question can be checked out from:
http://svn.sourceforge.net/svnroot/dash-framework/dash-obtain/branches/ajdt-bug

I've removed most of the jars so that checkout is small. The compiler settings make "advice did not match" an error so the failure in 
src/dash/obtain/aspects/ObtainStaticAspect.aj
should be easy to see.

The two test files that should match here are
tests/dash/obtain/ObtainStaticTests.java
tests/dash/obtain/ObtainStaticTestClass.java

Running the "Dash-Obtain-Tests" launcher (even with the compile error) will fail on that test.
Comment 1 Matt Chapman CLA 2006-09-14 06:19:42 EDT
Created attachment 50142 [details]
cut-down testcase

I've managed to reproduce the problem with the attached cut-down project via the following steps:

- after a full build, the advice is not matching anything
- open ObtainStaticTest.java and uncomment the System.out.println and save
- an incremental build occurs and now the advice is matching 3 places
  (the line uncommented above, plus the 2 places it should have matched in the    first place)
- do a full build
- now the aspect only matches one palce - the uncommented line
Comment 2 Matt Chapman CLA 2006-09-14 06:20:51 EDT
Passing over to compiler
Comment 3 Andrew Clement CLA 2006-09-14 10:37:40 EDT
thanks for trimming down the testcase Matt - and explaining what to expect between the compile stages.  I have committed the testcode and have almost got a fix I am happy with.
Comment 4 Andrew Clement CLA 2006-09-14 10:50:51 EDT
Fixes committed.
Comment 5 John D. Heintz CLA 2006-09-20 18:41:13 EDT
This is working from Ant/AspectJ now but still not from Eclipse/AJDT. 

I've updated AJDT to 1.4.1.200609201103 (from http://download.eclipse.org/tools/ajdt/32/dev/update)

The "cut-down testcase" doesn't work (and neither does the project this started with) still failing with an advice does not match warning.

thanks.
Comment 6 Helen Beeken CLA 2006-09-21 11:03:09 EDT
The latest 1.4 and 1.5 AJDT dev builds now contain this fix.
Comment 7 John D. Heintz CLA 2006-09-21 17:29:53 EDT
Thanks! Work as of AJDT 1.4.1.200609210900