blob: 27624bc6387b96af79e2a85ee55a9695e5ab9254 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
abstract aspect SuperAspect<T> {
pointcut takesAT() : execution(* *(T));
before() : takesAT() {
System.out.println("I matched at " + thisJoinPointStaticPart);
}
}
public aspect ExecutionAdviceInGenericAspect extends SuperAspect<String> {
public static void main(String[] args) {
C c = new C();
c.foo("well i never");
c.bar(5);
}
}
class C {
// should be matched
public void foo(String s) {}
// should not be matched
public void bar(Number n) {}
}
|