aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/generics/pointcuts/GetAndSetPointcutMatchingDeclaringType.aj
blob: 9bbfc5198cf118e687ab3151425861c1a6ad0aed (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
36
public aspect GetAndSetPointcutMatchingDeclaringType {
	
	// rule 2) a raw declaring type pattern matches any parameterized or generic type
	
	declare warning : get(* Generic.*) : "generic/param get matching ok";  // CW L15,33
	declare warning : set(* Generic.*) : "generic/param set matching ok";  // CW L12,32
}


class Generic<T> {
	
	public T foo = null;
	
	T getFoo() {
		return foo;
	}
	
}

interface ISore<E> {
	
	public static final int x = 5;
	
	void iSee(E anE);
	
}

class UglyBuilding implements ISore<String> {
	
	public void iSee(String s) {
		Generic<String> gs = new Generic<String>();
		gs.foo = "hi";  // set jp
		s.equals(gs.foo); // get jp
	}
	
}