blob: 7b93949f87201b27a3e0b7044ec2be623ad9a142 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import java.util.List;
public aspect SignatureWildcards {
declare warning : execution(* C.*(List)) : "any list";
declare warning : execution(* C.*(List<? extends Number>)) : "only foo";
declare warning : execution(* C.*(List<?>)) : "some list";
declare warning : execution(* C.*(List<? extends Object+>)) : "any list with upper bound";
}
class C {
public void foo(List<? extends Number> listOfSomeNumberType) {}
public void bar(List<?> listOfSomeType) {}
public void goo(List<Double> listOfDoubles) {}
}
|