Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
PerTarget - Bug or missunderstanding? was: [aspectj-dev] Set-Pointcut does not match

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks for the hint but unfortunately that was not the actual
problem.

I could reduce my test code to the following:

aspect PushUntilPop pertarget(pushPop()){

	int state;

	pointcut pushPop() : pu(Object) || po();
	pointcut pu(Object o): call(* IStack.push(..)) && args(o);
	pointcut po(): call(* IStack.pop());

	after() returning (Object o): po() {
		if(state==0) {
			System.out.println("0->2"+this);
			state=2;
		}
	}
	
	after(): set(* state) {
			System.out.println("Matched."+this);
	}

}

Don't bother about the first advice: It *will* be called at some
point. Thus, state will be set to two (if I set it from the outside,
it makes no difference).
The weird thing now is: If I use the pertarget above, the second
pointcut does never match. If I omit it, it matches as expected on
the set event in the first advice.
So what is going wrong here?

Eric

- -- 
Eric Bodden
Chair I2 for Programming Languages and Program Analysis
RWTH Aachen University

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQRsvfMwiFCm7RlWCEQLjewCfeUdvO4fcAO6ixoI8U7RUm0yGVi8An3kK
4q8Hl7Zsxvq2otHjIMmnR14A
=15gF
-----END PGP SIGNATURE-----




Back to the top