summaryrefslogtreecommitdiffstats
path: root/tests/java5/generics/pointcuts/WithinPointcutMatchingWarnings.aj
blob: 93a11bf68b74b7d91f5f61be07b8c41c643bb735 (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
public aspect WithinPointcutMatchingWarnings {
	
	// rule 2) a raw type pattern matches all jps within a generic type
	declare warning : set(* *) && within(Generic) : "matched set correctly";
	declare warning : execution(* *(..)) && within(Generic) : "matched execution correctly";
	
	// rule 3) a raw type pattern with + matches all jps within a parameterized type
	declare warning : within(ISore) : "init matched correctly";
	declare warning : execution(* *(..)) && within(ISore+) : "matched parameterization ok";
		
}


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) {}
	
}