blob: 8222e5e27592dc81b954668a37cf218b76fd4b2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import java.util.*;
public aspect AspectX {
static Set matchedJps = new HashSet();
before(): execution(* Number.compareTo(..)) {
matchedJps.add(new String("execution() matched on "+thisJoinPoint.toString()));
}
public static void main(String []argv) {
Number n1 = new Number(5);
Number n2 = new Number(7);
n1.compareTo(n2);
Iterator i = matchedJps.iterator();
while (i.hasNext()) {
String s = (String)i.next();
System.err.println(s);
}
}
}
|