Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Combination of Class Annotation and Method Annotation matching

Hi.

I have a question about annotation matching.
Here is my test code.
-----
public aspect TestAspect {
	declare warning : execution(@Annot * (@Annot *).*(..)) : "ok!";
	declare warning : execution(@Annot * (!@Annot *).*(..)) : "ng!";
}

@interface Annot{};

class Base{
	void func(){}
}

@Annot
class Derived extends Base{
	// ok! and ng!
	@Annot
	void func(){}
}

class NoAnnotClass{
	// ng!
	@Annot
	void func(){}
}
-----
See the message of Derived.func2.  This method seems to be affected by
two inconsistent "declare warning" of TestAspect.
Is that correct behavior? If so, how can I write a pointcut matching for
NoAnnotClass.func and not matching for Derived.func?

I'm using AJDT1.4.0(AspectJ1.5.2)

best regards.
takao.


Back to the top