View Javadoc
1   package gcUnrelatedTypes;
2   
3   import java.util.ArrayList;
4   
5   public class ArrayListContains0<T> {
6   
7   	static class Dummy {
8   
9   	}
10  
11  	static class DummyChild extends Dummy {
12  
13  	}
14  
15  	private ArrayList<?> wildcardF;
16  
17  	private ArrayList<Dummy> dummyF;
18  	private ArrayList<? extends Dummy> dummyEF;
19  	private ArrayList<? super Dummy> dummySF;
20  
21  	private ArrayList<DummyChild> childF;
22  	private ArrayList<? extends DummyChild> childEF;
23  	private ArrayList<? super DummyChild> childSF;
24  
25  	private ArrayList<T> genericF;		
26  	private ArrayList<? extends T> genericEF;
27  	private ArrayList<? super T> genericSF;		
28  
29  
30  	public ArrayListContains0(
31  			ArrayList<?> wildcardF, 
32  			ArrayList<Dummy> dummyF, 
33  			ArrayList<? extends Dummy> dummyEF, 
34  			ArrayList<? super Dummy> dummySF, 
35  			ArrayList<DummyChild> childF, 
36  			ArrayList<? extends DummyChild> childEF, 
37  			ArrayList<? super DummyChild> childSF, 
38  			ArrayList<T> genericF, 
39  			ArrayList<? extends T> genericEF, 
40  			ArrayList<? super T> genericSF) {
41  
42  		Dummy dummy = new Dummy();
43  		DummyChild dummyChild = new DummyChild();
44  		String s = "Mismatched Type";
45  
46  		wildcardF.contains(s); 					// No warning
47  
48  		dummyF.contains(s); 					// HIGH
49  
50  		dummyEF.contains(s); 					// HIGH
51  
52  		dummySF.contains(s); 					// HIGH
53  
54  		childF.contains(s); 					// HIGH
55  
56  		childEF.contains(s); 					// HIGH
57  
58  		childSF.contains(s); 					// HIGH
59  
60  
61  
62  	
63  	}
64  
65  
66  	}