blob: f0a034505046b80aca75d122c56f41b3c1ba63ed (
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
32
33
34
35
|
import java.util.AbstractList;
import java.util.LinkedList;
import java.util.List;
abstract aspect FooAspectParent<T extends List> {
protected int getNumber(int k) {
return -1*k;
}
}
abstract privileged aspect FooAspect<T extends AbstractList> extends FooAspectParent<T> {
pointcut pc(): call(T.new());
T around():pc() {
//getNumber(1); //<-- method call to superAspect fails
//method(); // <-- method call to abstract local defined method fails
localMethod(); //<-- method call to local private method fails
Math.random(); //<-- works
hashCode(); //<-- works
return null;
}
private void localMethod(){}
protected abstract T method();
}
/*
class Foo {
public LinkedList bar() {
new LinkedList();
return null;
}
}
*/
|