blob: 9dfd311b5254a090af13a66f8aad8a6d70c9c260 (
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
|
public aspect WithinPointcutMatching {
// rule 1) you can't use generic or parameterized type patterns with within
pointcut tryGeneric() : within(Generic<T>); // CE L 4
pointcut tryParameterized() : within(ISore<String>); // CE L5
pointcut tryBeingSneaky() : within(String || (Number || Generic<Double>)); // CE L6
}
class Generic<T> {
T foo = null;
T getFoo() {
return foo;
}
}
interface ISore<E> {
void iSee(E anE);
}
class UglyBuilding implements ISore<String> {
public void iSee(String s) {}
}
|