blob: 18e270548e8834b4cce75c279762a321539a578c (
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 ThisAndTargetPointcutMatching {
// rule 1) you can't use generic or parameterized type patterns with this and target
pointcut tryThisGeneric() : this(Generic<T>); // CE L 4
pointcut tryTargetGeneric() : target(Generic<T>); // CE L5
pointcut tryThisParameterized() : this(ISore<String>); // CE L6
pointcut tryTargetParameterized() : target(ISore<String>); // CE /7
}
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) {}
}
|