Bug 120521 - named pointcut not resolved in pertarget pointcut
Summary: named pointcut not resolved in pertarget pointcut
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-13 03:18 EST by Wes Isberg CLA
Modified: 2005-12-13 11:39 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wes Isberg CLA 2005-12-13 03:18:43 EST
Get incorrect error "can't find pointcut ..." when declaring pertarget pointcut using pointcut declared outside the aspect.  

True of HEAD right now.  Not true of pointcuts declared inside the aspect or issingleton aspects.

I thought this was reported and fixed, but I couldn't find the bug.  Sorry if it is a duplicate.

-------------------------------------------------
package bugs;

public class PerTargetSubaspectError {
	public static void main(String[] args) {
		C.run();
	}
	static class C {
		static void run() {}
	}
	pointcut doit() : execution(void C.run());

	// no error if not pertarget
	static aspect CPT pertarget(pc()){ 
                // no error if doit() defined in CPT
		protected pointcut pc() : doit(); // unexpected CE
		before() : doit() {} // no CE
	}
}
Comment 1 Andrew Clement CLA 2005-12-13 04:09:20 EST
this is a recent regression - I have a dev build from 30th November that doesnt have this problem.
Comment 2 Andrew Clement CLA 2005-12-13 06:32:27 EST
right, I've found it.  Not soooo much of a regression as exposing a problem we always had.  Sometimes during resolution we just 'defaulted' to persingleton as the perclause and used the right one later on.  To solve a problem with parameterized pertypewithin clauses I made the code return the *right* perclause in every case - so now we concretize the pc() in the pertarget clause - and we don't check the outertype for the pointcut definition.  I've fixed this to check the outertype - seems to work fine.

waiting on build.
Comment 3 Andrew Clement CLA 2005-12-13 11:39:23 EST
fix available.