View | Details | Raw Unified | Return to bug 149573 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java (-1 / +1 lines)
Lines 97-103 Link Here
97
		for (int i = 0; i < length; i++) {
97
		for (int i = 0; i < length; i++) {
98
			TypeBinding argument = originalArguments[i];
98
			TypeBinding argument = originalArguments[i];
99
			if (argument.kind() == Binding.WILDCARD_TYPE && ((WildcardBinding)argument).otherBounds == null) { // no capture for intersection types
99
			if (argument.kind() == Binding.WILDCARD_TYPE && ((WildcardBinding)argument).otherBounds == null) { // no capture for intersection types
100
				capturedArguments[i] = new CaptureBinding((WildcardBinding) argument, contextType, position);
100
				capturedArguments[i] = new CaptureBinding((WildcardBinding) argument, contextType, position, scope.compilationUnitScope().nextCaptureID());
101
			} else {
101
			} else {
102
				capturedArguments[i] = argument;
102
				capturedArguments[i] = argument;
103
			}
103
			}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java (-16 / +21 lines)
Lines 20-40 Link Here
20
20
21
public class CompilationUnitScope extends Scope {
21
public class CompilationUnitScope extends Scope {
22
	
22
	
23
public LookupEnvironment environment;
23
	public LookupEnvironment environment;
24
public CompilationUnitDeclaration referenceContext;
24
	public CompilationUnitDeclaration referenceContext;
25
public char[][] currentPackageName;
25
	public char[][] currentPackageName;
26
public PackageBinding fPackage;
26
	public PackageBinding fPackage;
27
public ImportBinding[] imports;
27
	public ImportBinding[] imports;
28
public HashtableOfObject typeOrPackageCache; // used in Scope.getTypeOrPackage()
28
	public HashtableOfObject typeOrPackageCache; // used in Scope.getTypeOrPackage()
29
29
	
30
public SourceTypeBinding[] topLevelTypes;
30
	public SourceTypeBinding[] topLevelTypes;
31
31
	
32
private CompoundNameVector qualifiedReferences;
32
	private CompoundNameVector qualifiedReferences;
33
private SimpleNameVector simpleNameReferences;
33
	private SimpleNameVector simpleNameReferences;
34
private ObjectVector referencedTypes;
34
	private ObjectVector referencedTypes;
35
private ObjectVector referencedSuperTypes;
35
	private ObjectVector referencedSuperTypes;
36
36
	
37
HashtableOfType constantPoolNameUsage;
37
	HashtableOfType constantPoolNameUsage;
38
	private int captureID = 1;
38
39
39
public CompilationUnitScope(CompilationUnitDeclaration unit, LookupEnvironment environment) {
40
public CompilationUnitScope(CompilationUnitDeclaration unit, LookupEnvironment environment) {
40
	super(COMPILATION_UNIT_SCOPE, null);
41
	super(COMPILATION_UNIT_SCOPE, null);
Lines 561-573 Link Here
561
		return findImport(compoundName, compoundName.length);
562
		return findImport(compoundName, compoundName.length);
562
	return findSingleImport(compoundName, isStaticImport);
563
	return findSingleImport(compoundName, isStaticImport);
563
}
564
}
565
566
public int nextCaptureID() {
567
	return this.captureID++;
568
}
569
564
/* Answer the problem reporter to use for raising new problems.
570
/* Answer the problem reporter to use for raising new problems.
565
*
571
*
566
* Note that as a side-effect, this updates the current reference context
572
* Note that as a side-effect, this updates the current reference context
567
* (unit, type or method) in case the problem handler decides it is necessary
573
* (unit, type or method) in case the problem handler decides it is necessary
568
* to abort.
574
* to abort.
569
*/
575
*/
570
571
public ProblemReporter problemReporter() {
576
public ProblemReporter problemReporter() {
572
	ProblemReporter problemReporter = referenceContext.problemReporter;
577
	ProblemReporter problemReporter = referenceContext.problemReporter;
573
	problemReporter.referenceContext = referenceContext;
578
	problemReporter.referenceContext = referenceContext;
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java (-1 / +2 lines)
Lines 43-49 Link Here
43
    char[] WILDCARD_MINUS = { '-' };
43
    char[] WILDCARD_MINUS = { '-' };
44
    char[] WILDCARD_STAR = { '*' };
44
    char[] WILDCARD_STAR = { '*' };
45
    char[] WILDCARD_PLUS = { '+' };
45
    char[] WILDCARD_PLUS = { '+' };
46
    char[] WILDCARD_CAPTURE_NAME = "capture-of ".toCharArray(); //$NON-NLS-1$
46
    char[] WILDCARD_CAPTURE_NAME_PREFIX = "capture#".toCharArray(); //$NON-NLS-1$
47
    char[] WILDCARD_CAPTURE_NAME_SUFFIX = "-of ".toCharArray(); //$NON-NLS-1$
47
	char[] WILDCARD_CAPTURE = { '!' };
48
	char[] WILDCARD_CAPTURE = { '!' };
48
	char[] BYTE = "byte".toCharArray(); //$NON-NLS-1$
49
	char[] BYTE = "byte".toCharArray(); //$NON-NLS-1$
49
	char[] SHORT = "short".toCharArray(); //$NON-NLS-1$
50
	char[] SHORT = "short".toCharArray(); //$NON-NLS-1$
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java (-7 / +40 lines)
Lines 18-35 Link Here
18
	
18
	
19
	public TypeBinding lowerBound;
19
	public TypeBinding lowerBound;
20
	public WildcardBinding wildcard;
20
	public WildcardBinding wildcard;
21
	public int captureID;
21
	
22
	
22
	/* information to compute unique binding key */
23
	/* information to compute unique binding key */
23
	public ReferenceBinding sourceType;
24
	public ReferenceBinding sourceType;
24
	public int position;
25
	public int position;
25
	
26
	
26
	public CaptureBinding(WildcardBinding wildcard, ReferenceBinding sourceType, int position) {
27
	public CaptureBinding(WildcardBinding wildcard, ReferenceBinding sourceType, int position, int captureID) {
27
		super(TypeConstants.WILDCARD_CAPTURE_NAME, null, 0);
28
		super(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX, null, 0);
28
		this.wildcard = wildcard;
29
		this.wildcard = wildcard;
29
		this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat capture as public
30
		this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat capture as public
30
		this.fPackage = wildcard.fPackage;
31
		this.fPackage = wildcard.fPackage;
31
		this.sourceType = sourceType;
32
		this.sourceType = sourceType;
32
		this.position = position;
33
		this.position = position;
34
		this.captureID = captureID;
33
	}
35
	}
34
36
35
	/*
37
	/*
Lines 54-61 Link Here
54
	}	
56
	}	
55
57
56
	public String debugName() {
58
	public String debugName() {
59
57
		if (this.wildcard != null) {
60
		if (this.wildcard != null) {
58
			return String.valueOf(TypeConstants.WILDCARD_CAPTURE_NAME) + this.wildcard.debugName();
61
			StringBuffer buffer = new StringBuffer(10);
62
			buffer
63
				.append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX)
64
				.append(this.captureID)
65
				.append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX)
66
				.append(this.wildcard.debugName());
67
			return buffer.toString();
59
		}
68
		}
60
		return super.debugName();
69
		return super.debugName();
61
	}
70
	}
Lines 156-176 Link Here
156
165
157
	public char[] readableName() {
166
	public char[] readableName() {
158
		if (this.wildcard != null) {
167
		if (this.wildcard != null) {
159
			return CharOperation.concat(TypeConstants.WILDCARD_CAPTURE_NAME, this.wildcard.readableName());
168
			StringBuffer buffer = new StringBuffer(10);
169
			buffer
170
				.append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX)
171
				.append(this.captureID)
172
				.append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX)
173
				.append(this.wildcard.readableName());
174
			int length = buffer.length();
175
			char[] name = new char[length];
176
			buffer.getChars(0, length, name, 0);
177
			return name;
160
		}
178
		}
161
		return super.readableName();
179
		return super.readableName();
162
	}
180
	}
163
	
181
	
164
	public char[] shortReadableName() {
182
	public char[] shortReadableName() {
165
		if (this.wildcard != null) {
183
		if (this.wildcard != null) {
166
			return CharOperation.concat(TypeConstants.WILDCARD_CAPTURE_NAME, this.wildcard.shortReadableName());
184
			StringBuffer buffer = new StringBuffer(10);
185
			buffer
186
				.append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX)
187
				.append(this.captureID)
188
				.append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX)
189
				.append(this.wildcard.shortReadableName());
190
			int length = buffer.length();
191
			char[] name = new char[length];
192
			buffer.getChars(0, length, name, 0);
193
			return name;
167
		}
194
		}
168
		return super.shortReadableName();
195
		return super.shortReadableName();		
169
	}
196
	}
170
	
197
	
171
	public String toString() {
198
	public String toString() {
172
		if (this.wildcard != null) {
199
		if (this.wildcard != null) {
173
			return String.valueOf(TypeConstants.WILDCARD_CAPTURE_NAME) + this.wildcard.toString();
200
			StringBuffer buffer = new StringBuffer(10);
201
			buffer
202
				.append(TypeConstants.WILDCARD_CAPTURE_NAME_PREFIX)
203
				.append(this.captureID)
204
				.append(TypeConstants.WILDCARD_CAPTURE_NAME_SUFFIX)
205
				.append(this.wildcard);
206
			return buffer.toString();
174
		}
207
		}
175
		return super.toString();
208
		return super.toString();
176
	}		
209
	}		
(-)src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java (-1 / +1 lines)
Lines 5183-5189 Link Here
5183
		assertNotNull("No node", node);
5183
		assertNotNull("No node", node);
5184
		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
5184
		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
5185
		CompilationUnit compilationUnit = (CompilationUnit) node;
5185
		CompilationUnit compilationUnit = (CompilationUnit) node;
5186
		assertProblemsSize(compilationUnit, 1, "Type safety: The cast from X.BB<capture-of ? extends Number,capture-of ? super Integer> to X.BD<Number> is actually checking against the erased type X.BD");
5186
		assertProblemsSize(compilationUnit, 1, "Type safety: The cast from X.BB<capture#1-of ? extends Number,capture#2-of ? super Integer> to X.BD<Number> is actually checking against the erased type X.BD");
5187
		node = getASTNode(compilationUnit, 0, 2, 1);
5187
		node = getASTNode(compilationUnit, 0, 2, 1);
5188
		assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
5188
		assertEquals("Not a variable declaration statement", ASTNode.VARIABLE_DECLARATION_STATEMENT, node.getNodeType());
5189
		VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
5189
		VariableDeclarationStatement statement = (VariableDeclarationStatement) node;
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (-201 / +220 lines)
Lines 3016-3022 Link Here
3016
			"3. ERROR in X.java (at line 9)\n" + 
3016
			"3. ERROR in X.java (at line 9)\n" + 
3017
			"	x.t.bar(\"ESS\");\n" + 
3017
			"	x.t.bar(\"ESS\");\n" + 
3018
			"	    ^^^\n" + 
3018
			"	    ^^^\n" + 
3019
			"The method bar(String) is undefined for the type capture-of ?\n" + 
3019
			"The method bar(String) is undefined for the type capture#2-of ?\n" + 
3020
			"----------\n");		
3020
			"----------\n");		
3021
	}		
3021
	}		
3022
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85303
3022
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85303
Lines 3810-3816 Link Here
3810
			"2. ERROR in X.java (at line 7)\n" + 
3810
			"2. ERROR in X.java (at line 7)\n" + 
3811
			"	Class<? extends X> c3 = s.getClass();\n" + 
3811
			"	Class<? extends X> c3 = s.getClass();\n" + 
3812
			"	                        ^^^^^^^^^^^^\n" + 
3812
			"	                        ^^^^^^^^^^^^\n" + 
3813
			"Type mismatch: cannot convert from Class<capture-of ? extends String> to Class<? extends X>\n" + 
3813
			"Type mismatch: cannot convert from Class<capture#3-of ? extends String> to Class<? extends X>\n" + 
3814
			"----------\n");
3814
			"----------\n");
3815
	}		
3815
	}		
3816
	// variation on test0128
3816
	// variation on test0128
Lines 3845-3851 Link Here
3845
			"2. ERROR in X.java (at line 8)\n" + 
3845
			"2. ERROR in X.java (at line 8)\n" + 
3846
			"	Class<? extends XY> c3 = s.getClass();\n" + 
3846
			"	Class<? extends XY> c3 = s.getClass();\n" + 
3847
			"	                         ^^^^^^^^^^^^\n" + 
3847
			"	                         ^^^^^^^^^^^^\n" + 
3848
			"Type mismatch: cannot convert from Class<capture-of ? extends String> to Class<? extends XY>\n" + 
3848
			"Type mismatch: cannot convert from Class<capture#3-of ? extends String> to Class<? extends XY>\n" + 
3849
			"----------\n" + 
3849
			"----------\n" + 
3850
			"3. ERROR in X.java (at line 14)\n" + 
3850
			"3. ERROR in X.java (at line 14)\n" + 
3851
			"	public Class <? extends Object> getClass() {\n" + 
3851
			"	public Class <? extends Object> getClass() {\n" + 
Lines 4030-4036 Link Here
4030
			"3. ERROR in Z.java (at line 6)\n" + 
4030
			"3. ERROR in Z.java (at line 6)\n" + 
4031
			"	zs.foo();\n" + 
4031
			"	zs.foo();\n" + 
4032
			"	   ^^^\n" + 
4032
			"	   ^^^\n" + 
4033
			"The method foo(Z<? super ZA>) in the type Z<capture-of ? super ZA> is not applicable for the arguments ()\n" + 
4033
			"The method foo(Z<? super ZA>) in the type Z<capture#1-of ? super ZA> is not applicable for the arguments ()\n" + 
4034
			"----------\n");
4034
			"----------\n");
4035
	}
4035
	}
4036
	public void test0137() {
4036
	public void test0137() {
Lines 4122-4128 Link Here
4122
			"2. ERROR in X.java (at line 10)\n" + 
4122
			"2. ERROR in X.java (at line 10)\n" + 
4123
			"	x.get().afoo();\n" + 
4123
			"	x.get().afoo();\n" + 
4124
			"	        ^^^^\n" + 
4124
			"	        ^^^^\n" + 
4125
			"The method afoo() is undefined for the type capture-of ? extends BX\n" + 
4125
			"The method afoo() is undefined for the type capture#1-of ? extends BX\n" + 
4126
			"----------\n");
4126
			"----------\n");
4127
	}		
4127
	}		
4128
	// extending wildcard considers its bound prior to its corresponding variable
4128
	// extending wildcard considers its bound prior to its corresponding variable
Lines 4184-4190 Link Here
4184
			"1. ERROR in X.java (at line 11)\n" + 
4184
			"1. ERROR in X.java (at line 11)\n" + 
4185
			"	x.get().bfoo();\n" + 
4185
			"	x.get().bfoo();\n" + 
4186
			"	        ^^^^\n" + 
4186
			"	        ^^^^\n" + 
4187
			"The method bfoo() is undefined for the type capture-of ? super BX\n" + 
4187
			"The method bfoo() is undefined for the type capture#2-of ? super BX\n" + 
4188
			"----------\n");
4188
			"----------\n");
4189
	}		
4189
	}		
4190
	public void test0142() {
4190
	public void test0142() {
Lines 4229-4235 Link Here
4229
			"3. ERROR in X.java (at line 10)\n" + 
4229
			"3. ERROR in X.java (at line 10)\n" + 
4230
			"	x = identity(x);\n" + 
4230
			"	x = identity(x);\n" + 
4231
			"	    ^^^^^^^^\n" + 
4231
			"	    ^^^^^^^^\n" + 
4232
			"Bound mismatch: The generic method identity(X<P>) of type X<T> is not applicable for the arguments (X<capture-of ? extends X>). The inferred type capture-of ? extends X is not a valid substitute for the bounded parameter <P extends AX>\n" + 
4232
			"Bound mismatch: The generic method identity(X<P>) of type X<T> is not applicable for the arguments (X<capture#2-of ? extends X>). The inferred type capture#2-of ? extends X is not a valid substitute for the bounded parameter <P extends AX>\n" + 
4233
			"----------\n");
4233
			"----------\n");
4234
	}			
4234
	}			
4235
	public void test0143() {
4235
	public void test0143() {
Lines 4248-4254 Link Here
4248
			"1. ERROR in X.java (at line 5)\n" + 
4248
			"1. ERROR in X.java (at line 5)\n" + 
4249
			"	Class<Object> xo2 = xx;\n" + 
4249
			"	Class<Object> xo2 = xx;\n" + 
4250
			"	                    ^^\n" + 
4250
			"	                    ^^\n" + 
4251
			"Type mismatch: cannot convert from Class<capture-of ? extends X> to Class<Object>\n" + 
4251
			"Type mismatch: cannot convert from Class<capture#2-of ? extends X> to Class<Object>\n" + 
4252
			"----------\n");
4252
			"----------\n");
4253
	}			
4253
	}			
4254
	public void test0144() {
4254
	public void test0144() {
Lines 4296-4312 Link Here
4296
			"1. ERROR in X.java (at line 6)\n" + 
4296
			"1. ERROR in X.java (at line 6)\n" + 
4297
			"	lx.add(x);\n" + 
4297
			"	lx.add(x);\n" + 
4298
			"	   ^^^\n" + 
4298
			"	   ^^^\n" + 
4299
			"The method add(capture-of ?) in the type XList<capture-of ?> is not applicable for the arguments (X)\n" + 
4299
			"The method add(capture#3-of ?) in the type XList<capture#3-of ?> is not applicable for the arguments (X)\n" + 
4300
			"----------\n" + 
4300
			"----------\n" + 
4301
			"2. ERROR in X.java (at line 7)\n" + 
4301
			"2. ERROR in X.java (at line 7)\n" + 
4302
			"	lx.slot = x;\n" + 
4302
			"	lx.slot = x;\n" + 
4303
			"	          ^\n" + 
4303
			"	          ^\n" + 
4304
			"Type mismatch: cannot convert from X to capture-of ?\n" + 
4304
			"Type mismatch: cannot convert from X to capture#4-of ?\n" + 
4305
			"----------\n" + 
4305
			"----------\n" + 
4306
			"3. ERROR in X.java (at line 8)\n" + 
4306
			"3. ERROR in X.java (at line 8)\n" + 
4307
			"	lx.addAll(lx);\n" + 
4307
			"	lx.addAll(lx);\n" + 
4308
			"	   ^^^^^^\n" + 
4308
			"	   ^^^^^^\n" + 
4309
			"The method addAll(XList<capture-of ?>) in the type XList<capture-of ?> is not applicable for the arguments (XList<capture-of ?>)\n" + 
4309
			"The method addAll(XList<capture#5-of ?>) in the type XList<capture#5-of ?> is not applicable for the arguments (XList<capture#6-of ?>)\n" + 
4310
			"----------\n");
4310
			"----------\n");
4311
	}
4311
	}
4312
	// 59628
4312
	// 59628
Lines 4623-4629 Link Here
4623
			"1. ERROR in X.java (at line 9)\n" + 
4623
			"1. ERROR in X.java (at line 9)\n" + 
4624
			"	return a.get();\n" + 
4624
			"	return a.get();\n" + 
4625
			"	       ^^^^^^^\n" + 
4625
			"	       ^^^^^^^\n" + 
4626
			"Type mismatch: cannot convert from capture-of ? to T\n" + 
4626
			"Type mismatch: cannot convert from capture#1-of ? to T\n" + 
4627
			"----------\n");
4627
			"----------\n");
4628
	}		
4628
	}		
4629
	public void test0160() {
4629
	public void test0160() {
Lines 4966-4972 Link Here
4966
			"2. ERROR in X.java (at line 9)\n" + 
4966
			"2. ERROR in X.java (at line 9)\n" + 
4967
			"	return a.get();\n" + 
4967
			"	return a.get();\n" + 
4968
			"	       ^^^^^^^\n" + 
4968
			"	       ^^^^^^^\n" + 
4969
			"Type mismatch: cannot convert from capture-of ? to T\n" + 
4969
			"Type mismatch: cannot convert from capture#1-of ? to T\n" + 
4970
			"----------\n");
4970
			"----------\n");
4971
	}
4971
	}
4972
	// Expected type inference for cast operation
4972
	// Expected type inference for cast operation
Lines 5000-5006 Link Here
5000
			"2. ERROR in X.java (at line 9)\n" + 
5000
			"2. ERROR in X.java (at line 9)\n" + 
5001
			"	return a.get();\n" + 
5001
			"	return a.get();\n" + 
5002
			"	       ^^^^^^^\n" + 
5002
			"	       ^^^^^^^\n" + 
5003
			"Type mismatch: cannot convert from capture-of ? to T\n" + 
5003
			"Type mismatch: cannot convert from capture#1-of ? to T\n" + 
5004
			"----------\n");
5004
			"----------\n");
5005
	}
5005
	}
5006
	// Expected type inference for cast operation
5006
	// Expected type inference for cast operation
Lines 6305-6311 Link Here
6305
			"1. ERROR in X.java (at line 7)\n" + 
6305
			"1. ERROR in X.java (at line 7)\n" + 
6306
			"	Integer i = al.get(0);  // (2)\n" + 
6306
			"	Integer i = al.get(0);  // (2)\n" + 
6307
			"	            ^^^^^^^^^\n" + 
6307
			"	            ^^^^^^^^^\n" + 
6308
			"Type mismatch: cannot convert from capture-of ? super Integer to Integer\n" + 
6308
			"Type mismatch: cannot convert from capture#2-of ? super Integer to Integer\n" + 
6309
			"----------\n");
6309
			"----------\n");
6310
	}		
6310
	}		
6311
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69141 variation
6311
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69141 variation
Lines 6326-6332 Link Here
6326
			"1. ERROR in X.java (at line 6)\n" + 
6326
			"1. ERROR in X.java (at line 6)\n" + 
6327
			"	al.add(new Integer(1)); // (1)\n" + 
6327
			"	al.add(new Integer(1)); // (1)\n" + 
6328
			"	   ^^^\n" + 
6328
			"	   ^^^\n" + 
6329
			"The method add(capture-of ? extends Integer) in the type ArrayList<capture-of ? extends Integer> is not applicable for the arguments (Integer)\n" + 
6329
			"The method add(capture#1-of ? extends Integer) in the type ArrayList<capture#1-of ? extends Integer> is not applicable for the arguments (Integer)\n" + 
6330
			"----------\n");
6330
			"----------\n");
6331
	}
6331
	}
6332
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69141: variation
6332
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69141: variation
Lines 6349-6355 Link Here
6349
			"1. ERROR in X.java (at line 5)\n" + 
6349
			"1. ERROR in X.java (at line 5)\n" + 
6350
			"	Integer i = lx.slot;\n" + 
6350
			"	Integer i = lx.slot;\n" + 
6351
			"	            ^^^^^^^\n" + 
6351
			"	            ^^^^^^^\n" + 
6352
			"Type mismatch: cannot convert from capture-of ? super Integer to Integer\n" + 
6352
			"Type mismatch: cannot convert from capture#2-of ? super Integer to Integer\n" + 
6353
			"----------\n");
6353
			"----------\n");
6354
	}	
6354
	}	
6355
	
6355
	
Lines 6617-6623 Link Here
6617
			"18. ERROR in X.java (at line 11)\n" + 
6617
			"18. ERROR in X.java (at line 11)\n" + 
6618
			"	void m6() { List c = null; List l = (Collection<?>)c; } // type mismatch\n" + 
6618
			"	void m6() { List c = null; List l = (Collection<?>)c; } // type mismatch\n" + 
6619
			"	                                    ^^^^^^^^^^^^^^^^\n" + 
6619
			"	                                    ^^^^^^^^^^^^^^^^\n" + 
6620
			"Type mismatch: cannot convert from Collection<capture-of ?> to List\n" + 
6620
			"Type mismatch: cannot convert from Collection<capture#2-of ?> to List\n" + 
6621
			"----------\n");
6621
			"----------\n");
6622
	}	
6622
	}	
6623
	// conversion from raw to X<?> is safe (no unsafe warning)
6623
	// conversion from raw to X<?> is safe (no unsafe warning)
Lines 6669-6675 Link Here
6669
			"1. ERROR in X.java (at line 8)\n" + 
6669
			"1. ERROR in X.java (at line 8)\n" + 
6670
			"	li= ln;\n" + 
6670
			"	li= ln;\n" + 
6671
			"	    ^^\n" + 
6671
			"	    ^^\n" + 
6672
			"Type mismatch: cannot convert from List<capture-of ? extends Number> to List<? extends Integer>\n" + 
6672
			"Type mismatch: cannot convert from List<capture#4-of ? extends Number> to List<? extends Integer>\n" + 
6673
			"----------\n");
6673
			"----------\n");
6674
	}
6674
	}
6675
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69170 - variation
6675
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69170 - variation
Lines 7323-7329 Link Here
7323
			"1. ERROR in X.java (at line 6)\n" + 
7323
			"1. ERROR in X.java (at line 6)\n" + 
7324
			"	return clazz.newInstance(); // ? extends Object\n" + 
7324
			"	return clazz.newInstance(); // ? extends Object\n" + 
7325
			"	       ^^^^^^^^^^^^^^^^^^^\n" + 
7325
			"	       ^^^^^^^^^^^^^^^^^^^\n" + 
7326
			"Type mismatch: cannot convert from capture-of ? extends Object to X.A\n" + 
7326
			"Type mismatch: cannot convert from capture#1-of ? extends Object to X.A\n" + 
7327
			"----------\n");
7327
			"----------\n");
7328
	}
7328
	}
7329
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69799 NPE in foreach checkcast
7329
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69799 NPE in foreach checkcast
Lines 7376-7387 Link Here
7376
			"1. WARNING in X.java (at line 6)\n" + 
7376
			"1. WARNING in X.java (at line 6)\n" + 
7377
			"	List<Number> x2= (List<Number>)ls;//unsafe\n" + 
7377
			"	List<Number> x2= (List<Number>)ls;//unsafe\n" + 
7378
			"	                 ^^^^^^^^^^^^^^^^\n" + 
7378
			"	                 ^^^^^^^^^^^^^^^^\n" + 
7379
			"Type safety: The cast from List<capture-of ? extends Number> to List<Number> is actually checking against the erased type List\n" + 
7379
			"Type safety: The cast from List<capture#1-of ? extends Number> to List<Number> is actually checking against the erased type List\n" + 
7380
			"----------\n" + 
7380
			"----------\n" + 
7381
			"2. ERROR in X.java (at line 11)\n" + 
7381
			"2. ERROR in X.java (at line 11)\n" + 
7382
			"	List<Number> ls2 = (List<? extends Number>)ls;\n" + 
7382
			"	List<Number> ls2 = (List<? extends Number>)ls;\n" + 
7383
			"	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
7383
			"	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
7384
			"Type mismatch: cannot convert from List<capture-of ? extends Number> to List<Number>\n" + 
7384
			"Type mismatch: cannot convert from List<capture#3-of ? extends Number> to List<Number>\n" + 
7385
			"----------\n" + 
7385
			"----------\n" + 
7386
			"3. WARNING in X.java (at line 12)\n" + 
7386
			"3. WARNING in X.java (at line 12)\n" + 
7387
			"	List<? extends Number> ls3 = (List<? extends Number>) li;\n" + 
7387
			"	List<? extends Number> ls3 = (List<? extends Number>) li;\n" + 
Lines 7615-7621 Link Here
7615
			"2. ERROR in X.java (at line 4)\n" + 
7615
			"2. ERROR in X.java (at line 4)\n" + 
7616
			"	XC<U> xcu1 = (XC<?>) new X<E>();			\n" + 
7616
			"	XC<U> xcu1 = (XC<?>) new X<E>();			\n" + 
7617
			"	             ^^^^^^^^^^^^^^^^^^\n" + 
7617
			"	             ^^^^^^^^^^^^^^^^^^\n" + 
7618
			"Type mismatch: cannot convert from XC<capture-of ?> to XC<U>\n" + 
7618
			"Type mismatch: cannot convert from XC<capture#1-of ?> to XC<U>\n" + 
7619
			"----------\n" + 
7619
			"----------\n" + 
7620
			"3. WARNING in X.java (at line 5)\n" + 
7620
			"3. WARNING in X.java (at line 5)\n" + 
7621
			"	XC<?> xcu2 = (XC<? extends X>) new X<E>();						\n" + 
7621
			"	XC<?> xcu2 = (XC<? extends X>) new X<E>();						\n" + 
Lines 10097-10103 Link Here
10097
			"1. ERROR in X.java (at line 4)\n" + 
10097
			"1. ERROR in X.java (at line 4)\n" + 
10098
			"	out.element = in.element;\n" + 
10098
			"	out.element = in.element;\n" + 
10099
			"	              ^^^^^^^^^^\n" + 
10099
			"	              ^^^^^^^^^^\n" + 
10100
			"Type mismatch: cannot convert from capture-of ? to capture-of ?\n" + 
10100
			"Type mismatch: cannot convert from capture#2-of ? to capture#1-of ?\n" + 
10101
			"----------\n");
10101
			"----------\n");
10102
	}
10102
	}
10103
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=75328
10103
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=75328
Lines 10363-10369 Link Here
10363
			"1. ERROR in X.java (at line 6)\n" + 
10363
			"1. ERROR in X.java (at line 6)\n" + 
10364
			"	m_values = values.entrySet();\n" + 
10364
			"	m_values = values.entrySet();\n" + 
10365
			"	           ^^^^^^^^^^^^^^^^^\n" + 
10365
			"	           ^^^^^^^^^^^^^^^^^\n" + 
10366
			"Type mismatch: cannot convert from Set<Map.Entry<Integer,capture-of ?>> to Set<Map.Entry<Integer,?>>\n" + 
10366
			"Type mismatch: cannot convert from Set<Map.Entry<Integer,capture#1-of ?>> to Set<Map.Entry<Integer,?>>\n" + 
10367
			"----------\n");
10367
			"----------\n");
10368
	}	
10368
	}	
10369
	// check param type equivalences
10369
	// check param type equivalences
Lines 10412-10418 Link Here
10412
			"1. ERROR in X.java (at line 9)\n" + 
10412
			"1. ERROR in X.java (at line 9)\n" + 
10413
			"	mx = x.createMX();\n" + 
10413
			"	mx = x.createMX();\n" + 
10414
			"	     ^^^^^^^^^^^^\n" + 
10414
			"	     ^^^^^^^^^^^^\n" + 
10415
			"Type mismatch: cannot convert from X<capture-of ?>.MX<capture-of ?> to X<T>.MX<?>\n" + 
10415
			"Type mismatch: cannot convert from X<capture#2-of ?>.MX<capture#2-of ?> to X<T>.MX<?>\n" + 
10416
			"----------\n");
10416
			"----------\n");
10417
	}		
10417
	}		
10418
	// check param type equivalences
10418
	// check param type equivalences
Lines 10542-10553 Link Here
10542
			"16. ERROR in X.java (at line 31)\n" + 
10542
			"16. ERROR in X.java (at line 31)\n" + 
10543
			"	target= value; // foo10 - wrong\n" + 
10543
			"	target= value; // foo10 - wrong\n" + 
10544
			"	        ^^^^^\n" + 
10544
			"	        ^^^^^\n" + 
10545
			"Type mismatch: cannot convert from MX<capture-of ? extends Object> to MX<? extends String>\n" + 
10545
			"Type mismatch: cannot convert from MX<capture#6-of ? extends Object> to MX<? extends String>\n" + 
10546
			"----------\n" + 
10546
			"----------\n" + 
10547
			"17. ERROR in X.java (at line 34)\n" + 
10547
			"17. ERROR in X.java (at line 34)\n" + 
10548
			"	target= value; // foo11 - wrong\n" + 
10548
			"	target= value; // foo11 - wrong\n" + 
10549
			"	        ^^^^^\n" + 
10549
			"	        ^^^^^\n" + 
10550
			"Type mismatch: cannot convert from MX<capture-of ? super String> to MX<? super Object>\n" + 
10550
			"Type mismatch: cannot convert from MX<capture#8-of ? super String> to MX<? super Object>\n" + 
10551
			"----------\n");
10551
			"----------\n");
10552
	}		
10552
	}		
10553
	// check param type equivalences
10553
	// check param type equivalences
Lines 10654-10660 Link Here
10654
			"1. ERROR in X.java (at line 3)\n" + 
10654
			"1. ERROR in X.java (at line 3)\n" + 
10655
			"	target = value;\n" + 
10655
			"	target = value;\n" + 
10656
			"	         ^^^^^\n" + 
10656
			"	         ^^^^^\n" + 
10657
			"Type mismatch: cannot convert from XC<capture-of ? extends Runnable> to XC<Runnable>\n" + 
10657
			"Type mismatch: cannot convert from XC<capture#1-of ? extends Runnable> to XC<Runnable>\n" + 
10658
			"----------\n");
10658
			"----------\n");
10659
	}			
10659
	}			
10660
	public void test0372() {
10660
	public void test0372() {
Lines 10764-10770 Link Here
10764
			"1. ERROR in X.java (at line 4)\n" + 
10764
			"1. ERROR in X.java (at line 4)\n" + 
10765
			"	target = value; // foo1\n" + 
10765
			"	target = value; // foo1\n" + 
10766
			"	         ^^^^^\n" + 
10766
			"	         ^^^^^\n" + 
10767
			"Type mismatch: cannot convert from X<capture-of ? extends Exception> to X<? super Exception>\n" + 
10767
			"Type mismatch: cannot convert from X<capture#2-of ? extends Exception> to X<? super Exception>\n" + 
10768
			"----------\n");
10768
			"----------\n");
10769
	}		
10769
	}		
10770
	public void test0376() {
10770
	public void test0376() {
Lines 11359-11365 Link Here
11359
			"1. ERROR in X.java (at line 5)\n" + 
11359
			"1. ERROR in X.java (at line 5)\n" + 
11360
			"	xnpe.element = new java.io.IOException();\n" + 
11360
			"	xnpe.element = new java.io.IOException();\n" + 
11361
			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
11361
			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
11362
			"Type mismatch: cannot convert from IOException to capture-of ? super NullPointerException\n" + 
11362
			"Type mismatch: cannot convert from IOException to capture#1-of ? super NullPointerException\n" + 
11363
			"----------\n");
11363
			"----------\n");
11364
	}			
11364
	}			
11365
11365
Lines 11707-11713 Link Here
11707
			"1. WARNING in X.java (at line 4)\n" + 
11707
			"1. WARNING in X.java (at line 4)\n" + 
11708
			"	X<String> x = (X<String>) xs;\n" + 
11708
			"	X<String> x = (X<String>) xs;\n" + 
11709
			"	              ^^^^^^^^^^^^^^\n" + 
11709
			"	              ^^^^^^^^^^^^^^\n" + 
11710
			"Type safety: The cast from X<capture-of ? extends String> to X<String> is actually checking against the erased type X\n" + 
11710
			"Type safety: The cast from X<capture#1-of ? extends String> to X<String> is actually checking against the erased type X\n" + 
11711
			"----------\n" + 
11711
			"----------\n" + 
11712
			"2. ERROR in X.java (at line 5)\n" + 
11712
			"2. ERROR in X.java (at line 5)\n" + 
11713
			"	Zork z;\n" + 
11713
			"	Zork z;\n" + 
Lines 11861-11872 Link Here
11861
			"1. ERROR in X.java (at line 11)\n" + 
11861
			"1. ERROR in X.java (at line 11)\n" + 
11862
			"	list.add(new Object());                       // should fail\n" + 
11862
			"	list.add(new Object());                       // should fail\n" + 
11863
			"	     ^^^\n" + 
11863
			"	     ^^^\n" + 
11864
			"The method add(capture-of ? super Exception) in the type List<capture-of ? super Exception> is not applicable for the arguments (Object)\n" + 
11864
			"The method add(capture#4-of ? super Exception) in the type List<capture#4-of ? super Exception> is not applicable for the arguments (Object)\n" + 
11865
			"----------\n" + 
11865
			"----------\n" + 
11866
			"2. ERROR in X.java (at line 12)\n" + 
11866
			"2. ERROR in X.java (at line 12)\n" + 
11867
			"	list.add(new Throwable());                    // should fail\n" + 
11867
			"	list.add(new Throwable());                    // should fail\n" + 
11868
			"	     ^^^\n" + 
11868
			"	     ^^^\n" + 
11869
			"The method add(capture-of ? super Exception) in the type List<capture-of ? super Exception> is not applicable for the arguments (Throwable)\n" + 
11869
			"The method add(capture#5-of ? super Exception) in the type List<capture#5-of ? super Exception> is not applicable for the arguments (Throwable)\n" + 
11870
			"----------\n");	
11870
			"----------\n");	
11871
	}			
11871
	}			
11872
	
11872
	
Lines 11903-11909 Link Here
11903
	}		
11903
	}		
11904
	
11904
	
11905
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78467 
11905
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78467 
11906
	public void testONLY_0412() {
11906
	public void test0412() {
11907
		this.runNegativeTest(
11907
		this.runNegativeTest(
11908
			new String[] {
11908
			new String[] {
11909
				"X.java",
11909
				"X.java",
Lines 11932-11938 Link Here
11932
			"----------\n");	
11932
			"----------\n");	
11933
	}
11933
	}
11934
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78467 - variation
11934
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78467 - variation
11935
	public void testONLY_0412a() {
11935
	public void test0412a() {
11936
		this.runNegativeTest(
11936
		this.runNegativeTest(
11937
			new String[] {
11937
			new String[] {
11938
				"X.java",
11938
				"X.java",
Lines 12830-12841 Link Here
12830
			"4. WARNING in X.java (at line 10)\n" + 
12830
			"4. WARNING in X.java (at line 10)\n" + 
12831
			"	list.add((T) other.get(0)); // checked cast\n" + 
12831
			"	list.add((T) other.get(0)); // checked cast\n" + 
12832
			"	         ^^^^^^^^^^^^^^^^\n" + 
12832
			"	         ^^^^^^^^^^^^^^^^\n" + 
12833
			"Unnecessary cast from capture-of ? extends T to T\n" + 
12833
			"Unnecessary cast from capture#1-of ? extends T to T\n" + 
12834
			"----------\n" + 
12834
			"----------\n" + 
12835
			"5. WARNING in X.java (at line 13)\n" + 
12835
			"5. WARNING in X.java (at line 13)\n" + 
12836
			"	list.add((T) other.get(0)); // unchecked cast\n" + 
12836
			"	list.add((T) other.get(0)); // unchecked cast\n" + 
12837
			"	         ^^^^^^^^^^^^^^^^\n" + 
12837
			"	         ^^^^^^^^^^^^^^^^\n" + 
12838
			"Type safety: The cast from capture-of ? super T to T is actually checking against the erased type Object\n" + 
12838
			"Type safety: The cast from capture#2-of ? super T to T is actually checking against the erased type Object\n" + 
12839
			"----------\n");
12839
			"----------\n");
12840
	}		
12840
	}		
12841
12841
Lines 13364-13370 Link Here
13364
			"1. ERROR in X.java (at line 9)\n" + 
13364
			"1. ERROR in X.java (at line 9)\n" + 
13365
			"	l.add(new X()); \n" + 
13365
			"	l.add(new X()); \n" + 
13366
			"	  ^^^\n" + 
13366
			"	  ^^^\n" + 
13367
			"The method add(capture-of ? extends X) in the type List<capture-of ? extends X> is not applicable for the arguments (X)\n" + 
13367
			"The method add(capture#2-of ? extends X) in the type List<capture#2-of ? extends X> is not applicable for the arguments (X)\n" + 
13368
			"----------\n" + 
13368
			"----------\n" + 
13369
			"2. ERROR in X.java (at line 17)\n" + 
13369
			"2. ERROR in X.java (at line 17)\n" + 
13370
			"	add3(lx, ls);\n" + 
13370
			"	add3(lx, ls);\n" + 
Lines 13460-13472 Link Here
13460
			"2. WARNING in X.java (at line 16)\n" + 
13460
			"2. WARNING in X.java (at line 16)\n" + 
13461
			"	return m_manager.getById(getClass(), new Integer(1));\n" + 
13461
			"	return m_manager.getById(getClass(), new Integer(1));\n" + 
13462
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
13462
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
13463
			"Type safety: Unchecked invocation getById(Class<capture-of ? extends Test>, Integer) of the generic method getById(Class<T>, Integer) of type Test.Manager<C>\n" + 
13463
			"Type safety: Unchecked invocation getById(Class<capture#1-of ? extends Test>, Integer) of the generic method getById(Class<T>, Integer) of type Test.Manager<C>\n" + 
13464
			"----------\n" + 
13464
			"----------\n" + 
13465
			"3. WARNING in X.java (at line 16)\n" + 
13465
			"3. WARNING in X.java (at line 16)\n" + 
13466
			"	return m_manager.getById(getClass(), new Integer(1));\n" + 
13466
			"	return m_manager.getById(getClass(), new Integer(1));\n" + 
13467
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
13467
			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
13468
			"Type safety: The expression of type capture-of ? extends Test needs unchecked conversion to conform to ITest<C>\n" + 
13468
			"Type safety: The expression of type capture#1-of ? extends Test needs unchecked conversion to conform to ITest<C>\n" + 
13469
			"----------\n"	);
13469
			"----------\n");
13470
	}
13470
	}
13471
	
13471
	
13472
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82439
13472
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82439
Lines 13508-13514 Link Here
13508
			"3. ERROR in X.java (at line 8)\n" + 
13508
			"3. ERROR in X.java (at line 8)\n" + 
13509
			"	Class<? extends Collection> d = getClazz(); // ko\n" + 
13509
			"	Class<? extends Collection> d = getClazz(); // ko\n" + 
13510
			"	                                ^^^^^^^^^^\n" + 
13510
			"	                                ^^^^^^^^^^\n" + 
13511
			"Type mismatch: cannot convert from Class<capture-of ? extends Object> to Class<? extends Collection>\n" + 
13511
			"Type mismatch: cannot convert from Class<capture#2-of ? extends Object> to Class<? extends Collection>\n" + 
13512
			"----------\n" + 
13512
			"----------\n" + 
13513
			"4. WARNING in X.java (at line 17)\n" + 
13513
			"4. WARNING in X.java (at line 17)\n" + 
13514
			"	Class<? extends Collection> c = getClass(); // ok\n" + 
13514
			"	Class<? extends Collection> c = getClass(); // ok\n" + 
Lines 13969-13975 Link Here
13969
			"1. ERROR in X.java (at line 5)\n" + 
13969
			"1. ERROR in X.java (at line 5)\n" + 
13970
			"	list.add(new Object());   // should fail\n" + 
13970
			"	list.add(new Object());   // should fail\n" + 
13971
			"	     ^^^\n" + 
13971
			"	     ^^^\n" + 
13972
			"The method add(capture-of ? super Number) in the type List<capture-of ? super Number> is not applicable for the arguments (Object)\n" + 
13972
			"The method add(capture#1-of ? super Number) in the type List<capture#1-of ? super Number> is not applicable for the arguments (Object)\n" + 
13973
			"----------\n");
13973
			"----------\n");
13974
	}		
13974
	}		
13975
	
13975
	
Lines 13991-13997 Link Here
13991
			"1. ERROR in X.java (at line 6)\n" + 
13991
			"1. ERROR in X.java (at line 6)\n" + 
13992
			"	lo = list;\n" + 
13992
			"	lo = list;\n" + 
13993
			"	     ^^^^\n" + 
13993
			"	     ^^^^\n" + 
13994
			"Type mismatch: cannot convert from List<capture-of ? super Number> to List<Object>\n" + 
13994
			"Type mismatch: cannot convert from List<capture#2-of ? super Number> to List<Object>\n" + 
13995
			"----------\n");
13995
			"----------\n");
13996
	}			
13996
	}			
13997
	
13997
	
Lines 14013-14019 Link Here
14013
			"1. ERROR in X.java (at line 6)\n" + 
14013
			"1. ERROR in X.java (at line 6)\n" + 
14014
			"	lhs.add(rhs.get(0));\n" + 
14014
			"	lhs.add(rhs.get(0));\n" + 
14015
			"	    ^^^\n" + 
14015
			"	    ^^^\n" + 
14016
			"The method add(capture-of ? super T) in the type List<capture-of ? super T> is not applicable for the arguments (capture-of ? extends Number)\n" + 
14016
			"The method add(capture#1-of ? super T) in the type List<capture#1-of ? super T> is not applicable for the arguments (capture#2-of ? extends Number)\n" + 
14017
			"----------\n");
14017
			"----------\n");
14018
	}		
14018
	}		
14019
	
14019
	
Lines 14035-14041 Link Here
14035
			"1. ERROR in X.java (at line 6)\n" + 
14035
			"1. ERROR in X.java (at line 6)\n" + 
14036
			"	lhs.add(rhs.get(0));\n" + 
14036
			"	lhs.add(rhs.get(0));\n" + 
14037
			"	    ^^^\n" + 
14037
			"	    ^^^\n" + 
14038
			"The method add(capture-of ? super Number) in the type List<capture-of ? super Number> is not applicable for the arguments (capture-of ? super U)\n" + 
14038
			"The method add(capture#1-of ? super Number) in the type List<capture#1-of ? super Number> is not applicable for the arguments (capture#2-of ? super U)\n" + 
14039
			"----------\n");
14039
			"----------\n");
14040
	}	
14040
	}	
14041
	
14041
	
Lines 14075-14081 Link Here
14075
			"1. ERROR in X.java (at line 6)\n" + 
14075
			"1. ERROR in X.java (at line 6)\n" + 
14076
			"	lhs.add(rhs.get(0));\n" + 
14076
			"	lhs.add(rhs.get(0));\n" + 
14077
			"	    ^^^\n" + 
14077
			"	    ^^^\n" + 
14078
			"The method add(capture-of ? super Integer) in the type List<capture-of ? super Integer> is not applicable for the arguments (capture-of ? extends Number)\n" + 
14078
			"The method add(capture#1-of ? super Integer) in the type List<capture#1-of ? super Integer> is not applicable for the arguments (capture#2-of ? extends Number)\n" + 
14079
			"----------\n");
14079
			"----------\n");
14080
	}			
14080
	}			
14081
14081
Lines 14098-14104 Link Here
14098
			"1. ERROR in X.java (at line 6)\n" + 
14098
			"1. ERROR in X.java (at line 6)\n" + 
14099
			"	lhs.add(rhs.get(0));\n" + 
14099
			"	lhs.add(rhs.get(0));\n" + 
14100
			"	    ^^^\n" + 
14100
			"	    ^^^\n" + 
14101
			"The method add(capture-of ? super Number) in the type List<capture-of ? super Number> is not applicable for the arguments (capture-of ? super Integer)\n" + 
14101
			"The method add(capture#1-of ? super Number) in the type List<capture#1-of ? super Number> is not applicable for the arguments (capture#2-of ? super Integer)\n" + 
14102
			"----------\n");
14102
			"----------\n");
14103
	}		
14103
	}		
14104
	
14104
	
Lines 14261-14267 Link Here
14261
			"1. ERROR in X.java (at line 6)\n" + 
14261
			"1. ERROR in X.java (at line 6)\n" + 
14262
			"	bar(l, \"\"); \n" + 
14262
			"	bar(l, \"\"); \n" + 
14263
			"	^^^\n" + 
14263
			"	^^^\n" + 
14264
			"The method bar(List<? super T>, T) in the type X is not applicable for the arguments (List<capture-of ?>, String)\n" + 
14264
			"The method bar(List<? super T>, T) in the type X is not applicable for the arguments (List<capture#1-of ?>, String)\n" + 
14265
			"----------\n");
14265
			"----------\n");
14266
	}
14266
	}
14267
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496
14267
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496
Lines 14287-14293 Link Here
14287
			"1. ERROR in X.java (at line 5)\n" + 
14287
			"1. ERROR in X.java (at line 5)\n" + 
14288
			"	f1.bar = f2.bar;\n" + 
14288
			"	f1.bar = f2.bar;\n" + 
14289
			"	         ^^^^^^\n" + 
14289
			"	         ^^^^^^\n" + 
14290
			"Type mismatch: cannot convert from X.Bar<capture-of ?> to X.Bar<capture-of ?>\n" + 
14290
			"Type mismatch: cannot convert from X.Bar<capture#2-of ?> to X.Bar<capture#1-of ?>\n" + 
14291
			"----------\n");
14291
			"----------\n");
14292
	}		
14292
	}		
14293
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496
14293
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496
Lines 14312-14318 Link Here
14312
			"1. ERROR in X.java (at line 4)\n" + 
14312
			"1. ERROR in X.java (at line 4)\n" + 
14313
			"	f1.bar = f1.bar;\n" + 
14313
			"	f1.bar = f1.bar;\n" + 
14314
			"	         ^^^^^^\n" + 
14314
			"	         ^^^^^^\n" + 
14315
			"Type mismatch: cannot convert from X.Bar<capture-of ?> to X.Bar<capture-of ?>\n" + 
14315
			"Type mismatch: cannot convert from X.Bar<capture#2-of ?> to X.Bar<capture#1-of ?>\n" + 
14316
			"----------\n");
14316
			"----------\n");
14317
	}		
14317
	}		
14318
	public void test0490() {
14318
	public void test0490() {
Lines 14335-14341 Link Here
14335
			"1. ERROR in X.java (at line 5)\n" + 
14335
			"1. ERROR in X.java (at line 5)\n" + 
14336
			"	lhs.t = rhs.t;\n" + 
14336
			"	lhs.t = rhs.t;\n" + 
14337
			"	        ^^^^^\n" + 
14337
			"	        ^^^^^\n" + 
14338
			"Type mismatch: cannot convert from capture-of ? to capture-of ?\n" + 
14338
			"Type mismatch: cannot convert from capture#4-of ? to capture#3-of ?\n" + 
14339
			"----------\n");
14339
			"----------\n");
14340
	}		
14340
	}		
14341
	
14341
	
Lines 14375-14406 Link Here
14375
			"1. ERROR in X.java (at line 5)\n" + 
14375
			"1. ERROR in X.java (at line 5)\n" + 
14376
			"	lhs.t = rhs.t;\n" + 
14376
			"	lhs.t = rhs.t;\n" + 
14377
			"	        ^^^^^\n" + 
14377
			"	        ^^^^^\n" + 
14378
			"Type mismatch: cannot convert from capture-of ? to capture-of ?\n" + 
14378
			"Type mismatch: cannot convert from capture#4-of ? to capture#3-of ?\n" + 
14379
			"----------\n" + 
14379
			"----------\n" + 
14380
			"2. ERROR in X.java (at line 12)\n" + 
14380
			"2. ERROR in X.java (at line 12)\n" + 
14381
			"	lhs = rhs;\n" + 
14381
			"	lhs = rhs;\n" + 
14382
			"	      ^^^\n" + 
14382
			"	      ^^^\n" + 
14383
			"Type mismatch: cannot convert from X<capture-of ? extends Number> to X<? super Number>\n" + 
14383
			"Type mismatch: cannot convert from X<capture#8-of ? extends Number> to X<? super Number>\n" + 
14384
			"----------\n" + 
14384
			"----------\n" + 
14385
			"3. ERROR in X.java (at line 17)\n" + 
14385
			"3. ERROR in X.java (at line 17)\n" + 
14386
			"	lhs.t = rhs.t;\n" + 
14386
			"	lhs.t = rhs.t;\n" + 
14387
			"	        ^^^^^\n" + 
14387
			"	        ^^^^^\n" + 
14388
			"Type mismatch: cannot convert from capture-of ? extends Number to capture-of ? extends Number\n" + 
14388
			"Type mismatch: cannot convert from capture#14-of ? extends Number to capture#13-of ? extends Number\n" + 
14389
			"----------\n" + 
14389
			"----------\n" + 
14390
			"4. ERROR in X.java (at line 20)\n" + 
14390
			"4. ERROR in X.java (at line 20)\n" + 
14391
			"	lhs = rhs;\n" + 
14391
			"	lhs = rhs;\n" + 
14392
			"	      ^^^\n" + 
14392
			"	      ^^^\n" + 
14393
			"Type mismatch: cannot convert from X<capture-of ? super Number> to X<? extends Number>\n" + 
14393
			"Type mismatch: cannot convert from X<capture#16-of ? super Number> to X<? extends Number>\n" + 
14394
			"----------\n" + 
14394
			"----------\n" + 
14395
			"5. ERROR in X.java (at line 21)\n" + 
14395
			"5. ERROR in X.java (at line 21)\n" + 
14396
			"	lhs.t = rhs.t;\n" + 
14396
			"	lhs.t = rhs.t;\n" + 
14397
			"	        ^^^^^\n" + 
14397
			"	        ^^^^^\n" + 
14398
			"Type mismatch: cannot convert from capture-of ? super Number to capture-of ? extends Number\n" + 
14398
			"Type mismatch: cannot convert from capture#18-of ? super Number to capture#17-of ? extends Number\n" + 
14399
			"----------\n" + 
14399
			"----------\n" + 
14400
			"6. ERROR in X.java (at line 25)\n" + 
14400
			"6. ERROR in X.java (at line 25)\n" + 
14401
			"	lhs.t = rhs.t;\n" + 
14401
			"	lhs.t = rhs.t;\n" + 
14402
			"	        ^^^^^\n" + 
14402
			"	        ^^^^^\n" + 
14403
			"Type mismatch: cannot convert from capture-of ? super Number to capture-of ? super Number\n" + 
14403
			"Type mismatch: cannot convert from capture#22-of ? super Number to capture#21-of ? super Number\n" + 
14404
			"----------\n");
14404
			"----------\n");
14405
	}		
14405
	}		
14406
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=81576
14406
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=81576
Lines 16543-16554 Link Here
16543
			"1. ERROR in X.java (at line 18)\n" + 
16543
			"1. ERROR in X.java (at line 18)\n" + 
16544
			"	lhs = rhs; // cannot convert\n" + 
16544
			"	lhs = rhs; // cannot convert\n" + 
16545
			"	      ^^^\n" + 
16545
			"	      ^^^\n" + 
16546
			"Type mismatch: cannot convert from X<capture-of ? extends Object> to X<String>\n" + 
16546
			"Type mismatch: cannot convert from X<capture#2-of ? extends Object> to X<String>\n" + 
16547
			"----------\n" + 
16547
			"----------\n" + 
16548
			"2. ERROR in X.java (at line 21)\n" + 
16548
			"2. ERROR in X.java (at line 21)\n" + 
16549
			"	lhs = rhs; // cannot convert\n" + 
16549
			"	lhs = rhs; // cannot convert\n" + 
16550
			"	      ^^^\n" + 
16550
			"	      ^^^\n" + 
16551
			"Type mismatch: cannot convert from X<capture-of ? extends Object> to X2\n" + 
16551
			"Type mismatch: cannot convert from X<capture#3-of ? extends Object> to X2\n" + 
16552
			"----------\n" + 
16552
			"----------\n" + 
16553
			"3. ERROR in X.java (at line 29)\n" + 
16553
			"3. ERROR in X.java (at line 29)\n" + 
16554
			"	void foo(X<String> xs) {}\n" + 
16554
			"	void foo(X<String> xs) {}\n" + 
Lines 16627-16633 Link Here
16627
			"1. WARNING in X.java (at line 9)\n" + 
16627
			"1. WARNING in X.java (at line 9)\n" + 
16628
			"	Object o = (DC<?>) (DA<?>) null;\n" + 
16628
			"	Object o = (DC<?>) (DA<?>) null;\n" + 
16629
			"	           ^^^^^^^^^^^^^^^^^^^^\n" + 
16629
			"	           ^^^^^^^^^^^^^^^^^^^^\n" + 
16630
			"Unnecessary cast from DA<capture-of ?> to DC<?>\n" + 
16630
			"Unnecessary cast from DA<capture#1-of ?> to DC<?>\n" + 
16631
			"----------\n" + 
16631
			"----------\n" + 
16632
			"2. WARNING in X.java (at line 9)\n" + 
16632
			"2. WARNING in X.java (at line 9)\n" + 
16633
			"	Object o = (DC<?>) (DA<?>) null;\n" + 
16633
			"	Object o = (DC<?>) (DA<?>) null;\n" + 
Lines 16675-16681 Link Here
16675
			"1. WARNING in X.java (at line 6)\n" + 
16675
			"1. WARNING in X.java (at line 6)\n" + 
16676
			"	X<U> foo = (X<U>)param;\n" + 
16676
			"	X<U> foo = (X<U>)param;\n" + 
16677
			"	           ^^^^^^^^^^^\n" + 
16677
			"	           ^^^^^^^^^^^\n" + 
16678
			"Type safety: The cast from X<capture-of ? super A> to X<U> is actually checking against the erased type X\n" + 
16678
			"Type safety: The cast from X<capture#1-of ? super A> to X<U> is actually checking against the erased type X\n" + 
16679
			"----------\n" + 
16679
			"----------\n" + 
16680
			"2. ERROR in X.java (at line 8)\n" + 
16680
			"2. ERROR in X.java (at line 8)\n" + 
16681
			"	Zork z;\n" + 
16681
			"	Zork z;\n" + 
Lines 16784-16795 Link Here
16784
			"1. WARNING in X.java (at line 8)\n" + 
16784
			"1. WARNING in X.java (at line 8)\n" + 
16785
			"	Object o1 = (X<String>) xo;\n" + 
16785
			"	Object o1 = (X<String>) xo;\n" + 
16786
			"	            ^^^^^^^^^^^^^^\n" + 
16786
			"	            ^^^^^^^^^^^^^^\n" + 
16787
			"Type safety: The cast from X<capture-of ? extends Object> to X<String> is actually checking against the erased type X\n" + 
16787
			"Type safety: The cast from X<capture#1-of ? extends Object> to X<String> is actually checking against the erased type X\n" + 
16788
			"----------\n" + 
16788
			"----------\n" + 
16789
			"2. WARNING in X.java (at line 8)\n" + 
16789
			"2. WARNING in X.java (at line 8)\n" + 
16790
			"	Object o1 = (X<String>) xo;\n" + 
16790
			"	Object o1 = (X<String>) xo;\n" + 
16791
			"	            ^^^^^^^^^^^^^^\n" + 
16791
			"	            ^^^^^^^^^^^^^^\n" + 
16792
			"Unnecessary cast from X<capture-of ? extends Object> to X<String>\n" + 
16792
			"Unnecessary cast from X<capture#1-of ? extends Object> to X<String>\n" + 
16793
			"----------\n" + 
16793
			"----------\n" + 
16794
			"3. WARNING in X.java (at line 9)\n" + 
16794
			"3. WARNING in X.java (at line 9)\n" + 
16795
			"	Object o2 = (X<? extends Object>) xs;\n" + 
16795
			"	Object o2 = (X<? extends Object>) xs;\n" + 
Lines 16799-16805 Link Here
16799
			"4. WARNING in X.java (at line 10)\n" + 
16799
			"4. WARNING in X.java (at line 10)\n" + 
16800
			"	Object o3 = (X2) xo;\n" + 
16800
			"	Object o3 = (X2) xo;\n" + 
16801
			"	            ^^^^^^^\n" + 
16801
			"	            ^^^^^^^\n" + 
16802
			"Unnecessary cast from X<capture-of ? extends Object> to X2\n" + 
16802
			"Unnecessary cast from X<capture#3-of ? extends Object> to X2\n" + 
16803
			"----------\n" + 
16803
			"----------\n" + 
16804
			"5. WARNING in X.java (at line 11)\n" + 
16804
			"5. WARNING in X.java (at line 11)\n" + 
16805
			"	Object o4 = (X<? extends Object>) x2;\n" + 
16805
			"	Object o4 = (X<? extends Object>) x2;\n" + 
Lines 16809-16820 Link Here
16809
			"6. WARNING in X.java (at line 12)\n" + 
16809
			"6. WARNING in X.java (at line 12)\n" + 
16810
			"	Object o5 = (X3<String>) xo;\n" + 
16810
			"	Object o5 = (X3<String>) xo;\n" + 
16811
			"	            ^^^^^^^^^^^^^^^\n" + 
16811
			"	            ^^^^^^^^^^^^^^^\n" + 
16812
			"Type safety: The cast from X<capture-of ? extends Object> to X3<String> is actually checking against the erased type X3\n" + 
16812
			"Type safety: The cast from X<capture#5-of ? extends Object> to X3<String> is actually checking against the erased type X3\n" + 
16813
			"----------\n" + 
16813
			"----------\n" + 
16814
			"7. WARNING in X.java (at line 12)\n" + 
16814
			"7. WARNING in X.java (at line 12)\n" + 
16815
			"	Object o5 = (X3<String>) xo;\n" + 
16815
			"	Object o5 = (X3<String>) xo;\n" + 
16816
			"	            ^^^^^^^^^^^^^^^\n" + 
16816
			"	            ^^^^^^^^^^^^^^^\n" + 
16817
			"Unnecessary cast from X<capture-of ? extends Object> to X3<String>\n" + 
16817
			"Unnecessary cast from X<capture#5-of ? extends Object> to X3<String>\n" + 
16818
			"----------\n" + 
16818
			"----------\n" + 
16819
			"8. ERROR in X.java (at line 18)\n" + 
16819
			"8. ERROR in X.java (at line 18)\n" + 
16820
			"	Zork z;\n" + 
16820
			"	Zork z;\n" + 
Lines 16841-16857 Link Here
16841
			"1. ERROR in X.java (at line 6)\n" + 
16841
			"1. ERROR in X.java (at line 6)\n" + 
16842
			"	xu = xn;\n" + 
16842
			"	xu = xn;\n" + 
16843
			"	     ^^\n" + 
16843
			"	     ^^\n" + 
16844
			"Type mismatch: cannot convert from X<capture-of ? extends Number> to X<? extends U>\n" + 
16844
			"Type mismatch: cannot convert from X<capture#4-of ? extends Number> to X<? extends U>\n" + 
16845
			"----------\n" + 
16845
			"----------\n" + 
16846
			"2. ERROR in X.java (at line 7)\n" + 
16846
			"2. ERROR in X.java (at line 7)\n" + 
16847
			"	xu.u = xn.u; // ko\n" + 
16847
			"	xu.u = xn.u; // ko\n" + 
16848
			"	       ^^^^\n" + 
16848
			"	       ^^^^\n" + 
16849
			"Type mismatch: cannot convert from capture-of ? extends Number to capture-of ? extends U\n" + 
16849
			"Type mismatch: cannot convert from capture#6-of ? extends Number to capture#5-of ? extends U\n" + 
16850
			"----------\n" + 
16850
			"----------\n" + 
16851
			"3. ERROR in X.java (at line 8)\n" + 
16851
			"3. ERROR in X.java (at line 8)\n" + 
16852
			"	xn.u = xu.u; // ko\n" + 
16852
			"	xn.u = xu.u; // ko\n" + 
16853
			"	       ^^^^\n" + 
16853
			"	       ^^^^\n" + 
16854
			"Type mismatch: cannot convert from capture-of ? extends U to capture-of ? extends Number\n" + 
16854
			"Type mismatch: cannot convert from capture#8-of ? extends U to capture#7-of ? extends Number\n" + 
16855
			"----------\n");
16855
			"----------\n");
16856
	}
16856
	}
16857
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87273
16857
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87273
Lines 17353-17359 Link Here
17353
			"3. WARNING in X.java (at line 8)\n" + 
17353
			"3. WARNING in X.java (at line 8)\n" + 
17354
			"	doWithEnumClass((Class<Enum>) cl);\n" + 
17354
			"	doWithEnumClass((Class<Enum>) cl);\n" + 
17355
			"	                ^^^^^^^^^^^^^^^^\n" + 
17355
			"	                ^^^^^^^^^^^^^^^^\n" + 
17356
			"Type safety: The cast from Class<capture-of ?> to Class<Enum> is actually checking against the erased type Class\n" + 
17356
			"Type safety: The cast from Class<capture#1-of ?> to Class<Enum> is actually checking against the erased type Class\n" + 
17357
			"----------\n" + 
17357
			"----------\n" + 
17358
			"4. WARNING in X.java (at line 8)\n" + 
17358
			"4. WARNING in X.java (at line 8)\n" + 
17359
			"	doWithEnumClass((Class<Enum>) cl);\n" + 
17359
			"	doWithEnumClass((Class<Enum>) cl);\n" + 
Lines 17418-17424 Link Here
17418
			"1. ERROR in X.java (at line 4)\n" + 
17418
			"1. ERROR in X.java (at line 4)\n" + 
17419
			"	(f1).bar = (f1).bar;\n" + 
17419
			"	(f1).bar = (f1).bar;\n" + 
17420
			"	           ^^^^^^^^\n" + 
17420
			"	           ^^^^^^^^\n" + 
17421
			"Type mismatch: cannot convert from X.Bar<capture-of ?> to X.Bar<capture-of ?>\n" + 
17421
			"Type mismatch: cannot convert from X.Bar<capture#2-of ?> to X.Bar<capture#1-of ?>\n" + 
17422
			"----------\n");
17422
			"----------\n");
17423
	}
17423
	}
17424
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496 - variation with single ref
17424
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496 - variation with single ref
Lines 17461-17467 Link Here
17461
			"1. ERROR in X.java (at line 4)\n" + 
17461
			"1. ERROR in X.java (at line 4)\n" + 
17462
			"	(f1).bar = f1.bar;\n" + 
17462
			"	(f1).bar = f1.bar;\n" + 
17463
			"	           ^^^^^^\n" + 
17463
			"	           ^^^^^^\n" + 
17464
			"Type mismatch: cannot convert from X.Bar<capture-of ?> to X.Bar<capture-of ?>\n" + 
17464
			"Type mismatch: cannot convert from X.Bar<capture#2-of ?> to X.Bar<capture#1-of ?>\n" + 
17465
			"----------\n");
17465
			"----------\n");
17466
	}	
17466
	}	
17467
	// check array bound for wildcard
17467
	// check array bound for wildcard
Lines 17498-17504 Link Here
17498
			"1. ERROR in X.java (at line 3)\n" + 
17498
			"1. ERROR in X.java (at line 3)\n" + 
17499
			"	int[] ints = box.get();\n" + 
17499
			"	int[] ints = box.get();\n" + 
17500
			"	             ^^^^^^^^^\n" + 
17500
			"	             ^^^^^^^^^\n" + 
17501
			"Type mismatch: cannot convert from capture-of ? super int[] to int[]\n" + 
17501
			"Type mismatch: cannot convert from capture#1-of ? super int[] to int[]\n" + 
17502
			"----------\n");
17502
			"----------\n");
17503
	}		
17503
	}		
17504
	// check array bound for wildcard
17504
	// check array bound for wildcard
Lines 17519-17525 Link Here
17519
			"1. ERROR in X.java (at line 3)\n" + 
17519
			"1. ERROR in X.java (at line 3)\n" + 
17520
			"	int[] ints = box.get();\n" + 
17520
			"	int[] ints = box.get();\n" + 
17521
			"	             ^^^^^^^^^\n" + 
17521
			"	             ^^^^^^^^^\n" + 
17522
			"Type mismatch: cannot convert from capture-of ? to int[]\n" + 
17522
			"Type mismatch: cannot convert from capture#1-of ? to int[]\n" + 
17523
			"----------\n");
17523
			"----------\n");
17524
	}
17524
	}
17525
	
17525
	
Lines 17545-17551 Link Here
17545
			"1. ERROR in X.java (at line 3)\n" + 
17545
			"1. ERROR in X.java (at line 3)\n" + 
17546
			"	f1.bar = f1.bar;\n" + 
17546
			"	f1.bar = f1.bar;\n" + 
17547
			"	         ^^^^^^\n" + 
17547
			"	         ^^^^^^\n" + 
17548
			"Type mismatch: cannot convert from Bar<capture-of ?> to Bar<capture-of ?>\n" + 
17548
			"Type mismatch: cannot convert from Bar<capture#2-of ?> to Bar<capture#1-of ?>\n" + 
17549
			"----------\n");            
17549
			"----------\n");            
17550
	}
17550
	}
17551
17551
Lines 17637-17653 Link Here
17637
				"		 }\n" + 
17637
				"		 }\n" + 
17638
				"}\n"
17638
				"}\n"
17639
            },
17639
            },
17640
			"----------\n" + 
17640
    		"----------\n" + 
17641
			"1. ERROR in X.java (at line 18)\n" + 
17641
    		"1. ERROR in X.java (at line 18)\n" + 
17642
			"	untypedList.addAll(untypedList2);\n" + 
17642
    		"	untypedList.addAll(untypedList2);\n" + 
17643
			"	            ^^^^^^\n" + 
17643
    		"	            ^^^^^^\n" + 
17644
			"The method addAll(Collection<? extends capture-of ?>) in the type List<capture-of ?> is not applicable for the arguments (List<capture-of ?>)\n" + 
17644
    		"The method addAll(Collection<? extends capture#1-of ?>) in the type List<capture#1-of ?> is not applicable for the arguments (List<capture#2-of ?>)\n" + 
17645
			"----------\n" + 
17645
    		"----------\n" + 
17646
			"2. ERROR in X.java (at line 22)\n" + 
17646
    		"2. ERROR in X.java (at line 22)\n" + 
17647
			"	Logger.log(\"Test_Lists.main: s: \" + s);\n" + 
17647
    		"	Logger.log(\"Test_Lists.main: s: \" + s);\n" + 
17648
			"	^^^^^^\n" + 
17648
    		"	^^^^^^\n" + 
17649
			"Logger cannot be resolved\n" + 
17649
    		"Logger cannot be resolved\n" + 
17650
			"----------\n");
17650
    		"----------\n");
17651
	}		
17651
	}		
17652
	
17652
	
17653
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90881
17653
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90881
Lines 17775-17786 Link Here
17775
				"	}\n" + 
17775
				"	}\n" + 
17776
				"}\n",
17776
				"}\n",
17777
            },
17777
            },
17778
			"----------\n" + 
17778
    		"----------\n" + 
17779
			"1. ERROR in X.java (at line 7)\n" + 
17779
    		"1. ERROR in X.java (at line 7)\n" + 
17780
			"	target.addAll(source);\n" + 
17780
    		"	target.addAll(source);\n" + 
17781
			"	       ^^^^^^\n" + 
17781
    		"	       ^^^^^^\n" + 
17782
			"The method addAll(Collection<? extends capture-of ? extends Number>) in the type List<capture-of ? extends Number> is not applicable for the arguments (List<capture-of ? extends Number>)\n" + 
17782
    		"The method addAll(Collection<? extends capture#1-of ? extends Number>) in the type List<capture#1-of ? extends Number> is not applicable for the arguments (List<capture#2-of ? extends Number>)\n" + 
17783
			"----------\n");
17783
    		"----------\n");
17784
	}		
17784
	}		
17785
17785
17786
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85281 - variation
17786
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85281 - variation
Lines 17800-17810 Link Here
17800
				"	}	\n" + 
17800
				"	}	\n" + 
17801
				"}\n",
17801
				"}\n",
17802
            },
17802
            },
17803
            "----------\n" + 
17803
    		"----------\n" + 
17804
    		"1. ERROR in X.java (at line 9)\n" + 
17804
    		"1. ERROR in X.java (at line 9)\n" + 
17805
    		"	Class<? super Number> superSup2 = ext.getSuperclass();\n" + 
17805
    		"	Class<? super Number> superSup2 = ext.getSuperclass();\n" + 
17806
    		"	                                  ^^^^^^^^^^^^^^^^^^^\n" + 
17806
    		"	                                  ^^^^^^^^^^^^^^^^^^^\n" + 
17807
    		"Type mismatch: cannot convert from Class<capture-of ? super capture-of ? extends Number> to Class<? super Number>\n" + 
17807
    		"Type mismatch: cannot convert from Class<capture#6-of ? super capture#5-of ? extends Number> to Class<? super Number>\n" + 
17808
    		"----------\n");
17808
    		"----------\n");
17809
	}
17809
	}
17810
	
17810
	
Lines 17897-17907 Link Here
17897
				"	}\n" + 
17897
				"	}\n" + 
17898
				"}\n",
17898
				"}\n",
17899
            },
17899
            },
17900
            "----------\n" + 
17900
    		"----------\n" + 
17901
    		"1. ERROR in X.java (at line 11)\n" + 
17901
    		"1. ERROR in X.java (at line 11)\n" + 
17902
    		"	Iterator<Entry<String, ?>> it = map.entrySet().iterator();\n" + 
17902
    		"	Iterator<Entry<String, ?>> it = map.entrySet().iterator();\n" + 
17903
    		"	                                ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
17903
    		"	                                ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
17904
    		"Type mismatch: cannot convert from Iterator<Map.Entry<String,capture-of ?>> to Iterator<Map.Entry<String,?>>\n" + 
17904
    		"Type mismatch: cannot convert from Iterator<Map.Entry<String,capture#1-of ?>> to Iterator<Map.Entry<String,?>>\n" + 
17905
    		"----------\n");
17905
    		"----------\n");
17906
	}		
17906
	}		
17907
	public void test0595() {
17907
	public void test0595() {
Lines 17926-17936 Link Here
17926
				"	}\n" + 
17926
				"	}\n" + 
17927
				"}\n",
17927
				"}\n",
17928
            },
17928
            },
17929
            "----------\n" + 
17929
    		"----------\n" + 
17930
    		"1. ERROR in X.java (at line 11)\n" + 
17930
    		"1. ERROR in X.java (at line 11)\n" + 
17931
    		"	Iterator<Entry<? extends String, ?>> it = map.entrySet().iterator();\n" + 
17931
    		"	Iterator<Entry<? extends String, ?>> it = map.entrySet().iterator();\n" + 
17932
    		"	                                          ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
17932
    		"	                                          ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
17933
    		"Type mismatch: cannot convert from Iterator<Map.Entry<capture-of ? extends String,capture-of ?>> to Iterator<Map.Entry<? extends String,?>>\n" + 
17933
    		"Type mismatch: cannot convert from Iterator<Map.Entry<capture#1-of ? extends String,capture#2-of ?>> to Iterator<Map.Entry<? extends String,?>>\n" + 
17934
    		"----------\n");
17934
    		"----------\n");
17935
	}		
17935
	}		
17936
	public void test0596() {
17936
	public void test0596() {
Lines 17968-17978 Link Here
17968
				"	F second;\n" + 
17968
				"	F second;\n" + 
17969
				"}\n",
17969
				"}\n",
17970
            },
17970
            },
17971
            "----------\n" + 
17971
    		"----------\n" + 
17972
    		"1. ERROR in X.java (at line 6)\n" + 
17972
    		"1. ERROR in X.java (at line 6)\n" + 
17973
    		"	x.m().first = x.m().second;\n" + 
17973
    		"	x.m().first = x.m().second;\n" + 
17974
    		"	              ^^^^^^^^^^^^\n" + 
17974
    		"	              ^^^^^^^^^^^^\n" + 
17975
    		"Type mismatch: cannot convert from capture-of ? to capture-of ?\n" + 
17975
    		"Type mismatch: cannot convert from capture#2-of ? to capture#1-of ?\n" + 
17976
    		"----------\n");
17976
    		"----------\n");
17977
	}		
17977
	}		
17978
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90879
17978
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90879
Lines 18146-18157 Link Here
18146
				"abstract class Values<T> {\n" + 
18146
				"abstract class Values<T> {\n" + 
18147
				"}\n",
18147
				"}\n",
18148
            },
18148
            },
18149
			"----------\n" + 
18149
    		"----------\n" + 
18150
			"1. ERROR in X.java (at line 4)\n" + 
18150
    		"1. ERROR in X.java (at line 4)\n" + 
18151
			"	return select(box.getValues());\n" + 
18151
    		"	return select(box.getValues());\n" + 
18152
			"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" + 
18152
    		"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" + 
18153
			"Type mismatch: cannot convert from Values<capture-of ? extends U> to Values<U>\n" + 
18153
    		"Type mismatch: cannot convert from Values<capture#1-of ? extends U> to Values<U>\n" + 
18154
			"----------\n");
18154
    		"----------\n");
18155
	}		
18155
	}		
18156
	public void test0602() {
18156
	public void test0602() {
18157
	    this.runNegativeTest(
18157
	    this.runNegativeTest(
Lines 18170-18181 Link Here
18170
				"abstract class Values<T> {\n" + 
18170
				"abstract class Values<T> {\n" + 
18171
				"}\n",
18171
				"}\n",
18172
            },
18172
            },
18173
			"----------\n" + 
18173
    		"----------\n" + 
18174
			"1. ERROR in X.java (at line 4)\n" + 
18174
    		"1. ERROR in X.java (at line 4)\n" + 
18175
			"	box.getValues()[0] = box.getValues()[1];\n" + 
18175
    		"	box.getValues()[0] = box.getValues()[1];\n" + 
18176
			"	                     ^^^^^^^^^^^^^^^^^^\n" + 
18176
    		"	                     ^^^^^^^^^^^^^^^^^^\n" + 
18177
			"Type mismatch: cannot convert from Values<capture-of ? extends U> to Values<capture-of ? extends U>\n" + 
18177
    		"Type mismatch: cannot convert from Values<capture#2-of ? extends U> to Values<capture#1-of ? extends U>\n" + 
18178
			"----------\n");
18178
    		"----------\n");
18179
	}		
18179
	}		
18180
	public void test0603() {
18180
	public void test0603() {
18181
	    this.runConformTest(
18181
	    this.runConformTest(
Lines 18235-18246 Link Here
18235
				"abstract class Values<T> {\n" + 
18235
				"abstract class Values<T> {\n" + 
18236
				"}\n",
18236
				"}\n",
18237
            },
18237
            },
18238
			"----------\n" + 
18238
    		"----------\n" + 
18239
			"1. ERROR in X.java (at line 4)\n" + 
18239
    		"1. ERROR in X.java (at line 4)\n" + 
18240
			"	box.getValues()[1] = box.getValues()[2];\n" + 
18240
    		"	box.getValues()[1] = box.getValues()[2];\n" + 
18241
			"	                     ^^^^^^^^^^^^^^^^^^\n" + 
18241
    		"	                     ^^^^^^^^^^^^^^^^^^\n" + 
18242
			"Type mismatch: cannot convert from Values<capture-of ? extends U> to Values<capture-of ? extends U>\n" + 
18242
    		"Type mismatch: cannot convert from Values<capture#2-of ? extends U> to Values<capture#1-of ? extends U>\n" + 
18243
			"----------\n");
18243
    		"----------\n");
18244
	}		
18244
	}		
18245
	public void test0606() {
18245
	public void test0606() {
18246
	    this.runNegativeTest(
18246
	    this.runNegativeTest(
Lines 18264-18270 Link Here
18264
    		"1. ERROR in X.java (at line 4)\n" + 
18264
    		"1. ERROR in X.java (at line 4)\n" + 
18265
    		"	box.getValues()[1] = (Values<? extends U>) box.getValues()[2];\n" + 
18265
    		"	box.getValues()[1] = (Values<? extends U>) box.getValues()[2];\n" + 
18266
    		"	                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
18266
    		"	                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
18267
    		"Type mismatch: cannot convert from Values<capture-of ? extends U> to Values<capture-of ? extends U>\n" + 
18267
    		"Type mismatch: cannot convert from Values<capture#3-of ? extends U> to Values<capture#1-of ? extends U>\n" + 
18268
    		"----------\n");
18268
    		"----------\n");
18269
	}		
18269
	}		
18270
	public void test0607() {
18270
	public void test0607() {
Lines 18612-18623 Link Here
18612
                "  }\n" + 
18612
                "  }\n" + 
18613
                "}\n",
18613
                "}\n",
18614
            },
18614
            },
18615
			"----------\n" + 
18615
    		"----------\n" + 
18616
			"1. ERROR in X.java (at line 6)\n" + 
18616
    		"1. ERROR in X.java (at line 6)\n" + 
18617
			"	s = var;\n" + 
18617
    		"	s = var;\n" + 
18618
			"	    ^^^\n" + 
18618
    		"	    ^^^\n" + 
18619
			"Type mismatch: cannot convert from ZZZ1<?>.ZZZ2<?>.ZZZ3<capture-of ?> to String\n" + 
18619
    		"Type mismatch: cannot convert from ZZZ1<?>.ZZZ2<?>.ZZZ3<capture#1-of ?> to String\n" + 
18620
			"----------\n");
18620
    		"----------\n");
18621
    }
18621
    }
18622
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973 - variation	
18622
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973 - variation	
18623
	public void test0618() {
18623
	public void test0618() {
Lines 18870-18880 Link Here
18870
				"	}\n" + 
18870
				"	}\n" + 
18871
				"}\n",
18871
				"}\n",
18872
            },
18872
            },
18873
            "----------\n" + 
18873
    		"----------\n" + 
18874
    		"1. ERROR in X.java (at line 9)\n" + 
18874
    		"1. ERROR in X.java (at line 9)\n" + 
18875
    		"	String s = foo(l1, l2);\n" + 
18875
    		"	String s = foo(l1, l2);\n" + 
18876
    		"	           ^^^^^^^^^^^\n" + 
18876
    		"	           ^^^^^^^^^^^\n" + 
18877
    		"Type mismatch: cannot convert from List<capture-of ? extends Object&Serializable&Comparable<?>> to String\n" + 
18877
    		"Type mismatch: cannot convert from List<capture#2-of ? extends Object&Serializable&Comparable<?>> to String\n" + 
18878
    		"----------\n");
18878
    		"----------\n");
18879
	}	
18879
	}	
18880
	// check capture for conditional operator
18880
	// check capture for conditional operator
Lines 18895-18905 Link Here
18895
				"	}\n" + 
18895
				"	}\n" + 
18896
				"}\n",
18896
				"}\n",
18897
            },
18897
            },
18898
            "----------\n" + 
18898
    		"----------\n" + 
18899
    		"1. ERROR in X.java (at line 10)\n" + 
18899
    		"1. ERROR in X.java (at line 10)\n" + 
18900
    		"	String s = l1 != null ? foo(l1, l2) : l3;\n" + 
18900
    		"	String s = l1 != null ? foo(l1, l2) : l3;\n" + 
18901
    		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
18901
    		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
18902
    		"Type mismatch: cannot convert from List<capture-of ? extends Object> to String\n" + 
18902
    		"Type mismatch: cannot convert from List<capture#4-of ? extends Object> to String\n" + 
18903
    		"----------\n");
18903
    		"----------\n");
18904
	}		
18904
	}		
18905
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92556
18905
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92556
Lines 18968-18974 Link Here
18968
			"1. ERROR in X.java (at line 17)\n" + 
18968
			"1. ERROR in X.java (at line 17)\n" + 
18969
			"	arrays.add(a); // Error: The method add(capture-of ? extends Number[]) in the type List<capture-of ? super Number[]> is not applicable for the arguments (Number[])\n" + 
18969
			"	arrays.add(a); // Error: The method add(capture-of ? extends Number[]) in the type List<capture-of ? super Number[]> is not applicable for the arguments (Number[])\n" + 
18970
			"	       ^^^\n" + 
18970
			"	       ^^^\n" + 
18971
			"The method add(capture-of ? extends Number[]) in the type List<capture-of ? extends Number[]> is not applicable for the arguments (Number[])\n" + 
18971
			"The method add(capture#4-of ? extends Number[]) in the type List<capture#4-of ? extends Number[]> is not applicable for the arguments (Number[])\n" + 
18972
			"----------\n");
18972
			"----------\n");
18973
	}
18973
	}
18974
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=93044	
18974
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=93044	
Lines 18991-18997 Link Here
18991
			"1. ERROR in X.java (at line 8)\n" + 
18991
			"1. ERROR in X.java (at line 8)\n" + 
18992
			"	System.out.println(Enum.valueOf(c, \"CLASS\"));\n" + 
18992
			"	System.out.println(Enum.valueOf(c, \"CLASS\"));\n" + 
18993
			"	                        ^^^^^^^\n" + 
18993
			"	                        ^^^^^^^\n" + 
18994
			"Bound mismatch: The generic method valueOf(Class<T>, String) of type Enum<E> is not applicable for the arguments (Class<capture-of ? extends Enum<?>>, String). The inferred type capture-of ? extends Enum<?> is not a valid substitute for the bounded parameter <T extends Enum<T>>\n" + 
18994
			"Bound mismatch: The generic method valueOf(Class<T>, String) of type Enum<E> is not applicable for the arguments (Class<capture#1-of ? extends Enum<?>>, String). The inferred type capture#1-of ? extends Enum<?> is not a valid substitute for the bounded parameter <T extends Enum<T>>\n" + 
18995
			"----------\n");
18995
			"----------\n");
18996
	}			
18996
	}			
18997
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=92982
18997
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=92982
Lines 19028-19044 Link Here
19028
			"1. ERROR in X.java (at line 12)\n" + 
19028
			"1. ERROR in X.java (at line 12)\n" + 
19029
			"	lhs.add(rhs.get(0));\n" + 
19029
			"	lhs.add(rhs.get(0));\n" + 
19030
			"	    ^^^\n" + 
19030
			"	    ^^^\n" + 
19031
			"The method add(capture-of ? extends Object[]) in the type Vector<capture-of ? extends Object[]> is not applicable for the arguments (capture-of ? extends Object[])\n" + 
19031
			"The method add(capture#3-of ? extends Object[]) in the type Vector<capture#3-of ? extends Object[]> is not applicable for the arguments (capture#4-of ? extends Object[])\n" + 
19032
			"----------\n" + 
19032
			"----------\n" + 
19033
			"2. ERROR in X.java (at line 17)\n" + 
19033
			"2. ERROR in X.java (at line 17)\n" + 
19034
			"	lhs.add(rhs.get(0));\n" + 
19034
			"	lhs.add(rhs.get(0));\n" + 
19035
			"	    ^^^\n" + 
19035
			"	    ^^^\n" + 
19036
			"The method add(capture-of ? super Object[]) in the type Vector<capture-of ? super Object[]> is not applicable for the arguments (capture-of ? super Object[])\n" + 
19036
			"The method add(capture#5-of ? super Object[]) in the type Vector<capture#5-of ? super Object[]> is not applicable for the arguments (capture#6-of ? super Object[])\n" + 
19037
			"----------\n" + 
19037
			"----------\n" + 
19038
			"3. ERROR in X.java (at line 22)\n" + 
19038
			"3. ERROR in X.java (at line 22)\n" + 
19039
			"	lhs.add(rhs.get(0));\n" + 
19039
			"	lhs.add(rhs.get(0));\n" + 
19040
			"	    ^^^\n" + 
19040
			"	    ^^^\n" + 
19041
			"The method add(capture-of ? extends Object[]) in the type Vector<capture-of ? extends Object[]> is not applicable for the arguments (capture-of ? super Object[])\n" + 
19041
			"The method add(capture#7-of ? extends Object[]) in the type Vector<capture#7-of ? extends Object[]> is not applicable for the arguments (capture#8-of ? super Object[])\n" + 
19042
			"----------\n");
19042
			"----------\n");
19043
	}				
19043
	}				
19044
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=92982 - variation
19044
	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=92982 - variation
Lines 19876-19887 Link Here
19876
		"1. WARNING in X.java (at line 6)\n" + 
19876
		"1. WARNING in X.java (at line 6)\n" + 
19877
		"	Object o = (BD<Number>) bb;\n" + 
19877
		"	Object o = (BD<Number>) bb;\n" + 
19878
		"	           ^^^^^^^^^^^^^^^\n" + 
19878
		"	           ^^^^^^^^^^^^^^^\n" + 
19879
		"Type safety: The cast from X.BB<capture-of ? extends Number,capture-of ? super Integer> to X.BD<Number> is actually checking against the erased type X.BD\n" + 
19879
		"Type safety: The cast from X.BB<capture#1-of ? extends Number,capture#2-of ? super Integer> to X.BD<Number> is actually checking against the erased type X.BD\n" + 
19880
		"----------\n" + 
19880
		"----------\n" + 
19881
		"2. WARNING in X.java (at line 6)\n" + 
19881
		"2. WARNING in X.java (at line 6)\n" + 
19882
		"	Object o = (BD<Number>) bb;\n" + 
19882
		"	Object o = (BD<Number>) bb;\n" + 
19883
		"	           ^^^^^^^^^^^^^^^\n" + 
19883
		"	           ^^^^^^^^^^^^^^^\n" + 
19884
		"Unnecessary cast from X.BB<capture-of ? extends Number,capture-of ? super Integer> to X.BD<Number>\n" + 
19884
		"Unnecessary cast from X.BB<capture#1-of ? extends Number,capture#2-of ? super Integer> to X.BD<Number>\n" + 
19885
		"----------\n" + 
19885
		"----------\n" + 
19886
		"3. ERROR in X.java (at line 8)\n" + 
19886
		"3. ERROR in X.java (at line 8)\n" + 
19887
		"	Zork z;\n" + 
19887
		"	Zork z;\n" + 
Lines 20037-20043 Link Here
20037
		"2. WARNING in X.java (at line 34)\n" + 
20037
		"2. WARNING in X.java (at line 34)\n" + 
20038
		"	X<String, Integer> fromQueue = (X<String, Integer>) queue.remove();\n" + 
20038
		"	X<String, Integer> fromQueue = (X<String, Integer>) queue.remove();\n" + 
20039
		"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
20039
		"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
20040
		"Type safety: The cast from Reference<capture-of ? extends Integer> to X<String,Integer> is actually checking against the erased type X\n" + 
20040
		"Type safety: The cast from Reference<capture#1-of ? extends Integer> to X<String,Integer> is actually checking against the erased type X\n" + 
20041
		"----------\n");
20041
		"----------\n");
20042
}	
20042
}	
20043
public void test0660() {
20043
public void test0660() {
Lines 21169-21175 Link Here
21169
		"1. ERROR in X.java (at line 6)\n" + 
21169
		"1. ERROR in X.java (at line 6)\n" + 
21170
		"	X<String> x = foo(x1, x2);\n" + 
21170
		"	X<String> x = foo(x1, x2);\n" + 
21171
		"	              ^^^^^^^^^^^\n" + 
21171
		"	              ^^^^^^^^^^^\n" + 
21172
		"Type mismatch: cannot convert from X<capture-of ? extends Object> to X<String>\n" + 
21172
		"Type mismatch: cannot convert from X<capture#3-of ? extends Object> to X<String>\n" + 
21173
		"----------\n");
21173
		"----------\n");
21174
}	
21174
}	
21175
public void test0685() {
21175
public void test0685() {
Lines 21189-21195 Link Here
21189
		"1. ERROR in X.java (at line 6)\n" + 
21189
		"1. ERROR in X.java (at line 6)\n" + 
21190
		"	X<String> x = foo(x1, x2);\n" + 
21190
		"	X<String> x = foo(x1, x2);\n" + 
21191
		"	              ^^^^^^^^^^^\n" + 
21191
		"	              ^^^^^^^^^^^\n" + 
21192
		"Type mismatch: cannot convert from X<capture-of ? extends Object> to X<String>\n" + 
21192
		"Type mismatch: cannot convert from X<capture#3-of ? extends Object> to X<String>\n" + 
21193
		"----------\n");
21193
		"----------\n");
21194
}	
21194
}	
21195
// check wildcard bounds wrt variable boundCheck
21195
// check wildcard bounds wrt variable boundCheck
Lines 21312-21318 Link Here
21312
		"1. ERROR in X.java (at line 4)\n" + 
21312
		"1. ERROR in X.java (at line 4)\n" + 
21313
		"	lr = la;\n" + 
21313
		"	lr = la;\n" + 
21314
		"	     ^^\n" + 
21314
		"	     ^^\n" + 
21315
		"Type mismatch: cannot convert from List<capture-of ?> to List<? extends Runnable>\n" + 
21315
		"Type mismatch: cannot convert from List<capture#2-of ?> to List<? extends Runnable>\n" + 
21316
		"----------\n");
21316
		"----------\n");
21317
}
21317
}
21318
// check that final class bound is more restrictive
21318
// check that final class bound is more restrictive
Lines 23048-23054 Link Here
23048
		"1. ERROR in X.java (at line 4)\n" + 
23048
		"1. ERROR in X.java (at line 4)\n" + 
23049
		"	X<T> x2 = x;\n" + 
23049
		"	X<T> x2 = x;\n" + 
23050
		"	          ^\n" + 
23050
		"	          ^\n" + 
23051
		"Type mismatch: cannot convert from X<capture-of ? extends T> to X<T>\n" + 
23051
		"Type mismatch: cannot convert from X<capture#1-of ? extends T> to X<T>\n" + 
23052
		"----------\n");
23052
		"----------\n");
23053
}
23053
}
23054
public void test0752() {
23054
public void test0752() {
Lines 23072-23078 Link Here
23072
		"1. ERROR in X.java (at line 7)\n" + 
23072
		"1. ERROR in X.java (at line 7)\n" + 
23073
		"	current = current.parent;\n" + 
23073
		"	current = current.parent;\n" + 
23074
		"	          ^^^^^^^^^^^^^^\n" + 
23074
		"	          ^^^^^^^^^^^^^^\n" + 
23075
		"Type mismatch: cannot convert from X<capture-of ? extends I<capture-of ? extends I<E>>> to X<? extends I<E>>\n" + 
23075
		"Type mismatch: cannot convert from X<capture#3-of ? extends I<capture#2-of ? extends I<E>>> to X<? extends I<E>>\n" + 
23076
		"----------\n");
23076
		"----------\n");
23077
}
23077
}
23078
public void test0753() {
23078
public void test0753() {
Lines 23106-23112 Link Here
23106
		"3. ERROR in X.java (at line 7)\n" + 
23106
		"3. ERROR in X.java (at line 7)\n" + 
23107
		"	current = current.parent;\n" + 
23107
		"	current = current.parent;\n" + 
23108
		"	          ^^^^^^^^^^^^^^\n" + 
23108
		"	          ^^^^^^^^^^^^^^\n" + 
23109
		"Type mismatch: cannot convert from X<capture-of ? super I<capture-of ? super I<E>>> to X<? super I<E>>\n" + 
23109
		"Type mismatch: cannot convert from X<capture#3-of ? super I<capture#2-of ? super I<E>>> to X<? super I<E>>\n" + 
23110
		"----------\n");
23110
		"----------\n");
23111
}
23111
}
23112
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=99578
23112
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=99578
Lines 24158-24164 Link Here
24158
		"1. ERROR in X.java (at line 8)\n" + 
24158
		"1. ERROR in X.java (at line 8)\n" + 
24159
		"	getLonger(list, set);\n" + 
24159
		"	getLonger(list, set);\n" + 
24160
		"	^^^^^^^^^\n" + 
24160
		"	^^^^^^^^^\n" + 
24161
		"Bound mismatch: The generic method getLonger(T, T) of type X is not applicable for the arguments (HashSet<capture-of ?>, ArrayList<capture-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends Number>>\n" + 
24161
		"Bound mismatch: The generic method getLonger(T, T) of type X is not applicable for the arguments (HashSet<capture#1-of ?>, ArrayList<capture#2-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends Number>>\n" + 
24162
		"----------\n");
24162
		"----------\n");
24163
}
24163
}
24164
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=103528 - variation
24164
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=103528 - variation
Lines 24199-24205 Link Here
24199
		"1. ERROR in X.java (at line 8)\n" + 
24199
		"1. ERROR in X.java (at line 8)\n" + 
24200
		"	getLonger(list, set);\n" + 
24200
		"	getLonger(list, set);\n" + 
24201
		"	^^^^^^^^^\n" + 
24201
		"	^^^^^^^^^\n" + 
24202
		"Bound mismatch: The generic method getLonger(T, T) of type X<U> is not applicable for the arguments (HashSet<capture-of ?>, ArrayList<capture-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends U>>\n" + 
24202
		"Bound mismatch: The generic method getLonger(T, T) of type X<U> is not applicable for the arguments (HashSet<capture#1-of ?>, ArrayList<capture#2-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends U>>\n" + 
24203
		"----------\n");
24203
		"----------\n");
24204
}
24204
}
24205
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=103994
24205
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=103994
Lines 24294-24300 Link Here
24294
		"2. ERROR in X.java (at line 15)\n" + 
24294
		"2. ERROR in X.java (at line 15)\n" + 
24295
		"	isGreater(c1, c2);\n" + 
24295
		"	isGreater(c1, c2);\n" + 
24296
		"	^^^^^^^^^\n" + 
24296
		"	^^^^^^^^^\n" + 
24297
		"Bound mismatch: The generic method isGreater(T, T) of type X is not applicable for the arguments (Comparable<capture-of ? extends Number>, Comparable<capture-of ? extends Number>). The inferred type Comparable<? extends Number> is not a valid substitute for the bounded parameter <T extends Comparable<T>>\n" + 
24297
		"Bound mismatch: The generic method isGreater(T, T) of type X is not applicable for the arguments (Comparable<capture#1-of ? extends Number>, Comparable<capture#2-of ? extends Number>). The inferred type Comparable<? extends Number> is not a valid substitute for the bounded parameter <T extends Comparable<T>>\n" + 
24298
		"----------\n" + 
24298
		"----------\n" + 
24299
		"3. WARNING in X.java (at line 18)\n" + 
24299
		"3. WARNING in X.java (at line 18)\n" + 
24300
		"	Comparable c1= i;\n" + 
24300
		"	Comparable c1= i;\n" + 
Lines 24546-24552 Link Here
24546
		"4. WARNING in X.java (at line 13)\n" + 
24546
		"4. WARNING in X.java (at line 13)\n" + 
24547
		"	ref.next = first == null ? ref : first;\n" + 
24547
		"	ref.next = first == null ? ref : first;\n" + 
24548
		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
24548
		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
24549
		"Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture-of ? extends T>\n" + 
24549
		"Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#2-of ? extends T>\n" + 
24550
		"----------\n" + 
24550
		"----------\n" + 
24551
		"5. ERROR in X.java (at line 14)\n" + 
24551
		"5. ERROR in X.java (at line 14)\n" + 
24552
		"	String s = first == null ? ref : first;\n" + 
24552
		"	String s = first == null ? ref : first;\n" + 
Lines 24556-24562 Link Here
24556
		"6. WARNING in X.java (at line 15)\n" + 
24556
		"6. WARNING in X.java (at line 15)\n" + 
24557
		"	ref.next = first2 == null ? ref : first2;\n" + 
24557
		"	ref.next = first2 == null ? ref : first2;\n" + 
24558
		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
24558
		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
24559
		"Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture-of ? extends T>\n" + 
24559
		"Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#5-of ? extends T>\n" + 
24560
		"----------\n" + 
24560
		"----------\n" + 
24561
		"7. WARNING in X.java (at line 18)\n" + 
24561
		"7. WARNING in X.java (at line 18)\n" + 
24562
		"	return first == null ? ref : first;\n" + 
24562
		"	return first == null ? ref : first;\n" + 
Lines 24689-24695 Link Here
24689
		"1. ERROR in X.java (at line 13)\n" + 
24689
		"1. ERROR in X.java (at line 13)\n" + 
24690
		"	return true ? superList : superList;\n" + 
24690
		"	return true ? superList : superList;\n" + 
24691
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
24691
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
24692
		"Type mismatch: cannot convert from ArrayList<capture-of ? extends Object> to ArrayList<? super A>\n" + 
24692
		"Type mismatch: cannot convert from ArrayList<capture#3-of ? extends Object> to ArrayList<? super A>\n" + 
24693
		"----------\n");
24693
		"----------\n");
24694
}
24694
}
24695
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106865
24695
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106865
Lines 24724-24735 Link Here
24724
		"1. ERROR in X.java (at line 13)\n" + 
24724
		"1. ERROR in X.java (at line 13)\n" + 
24725
		"	y.foo(os);\n" + 
24725
		"	y.foo(os);\n" + 
24726
		"	  ^^^\n" + 
24726
		"	  ^^^\n" + 
24727
		"The method foo(capture-of ? extends Object[]) in the type Y<capture-of ? extends Object[]> is not applicable for the arguments (Object[])\n" + 
24727
		"The method foo(capture#3-of ? extends Object[]) in the type Y<capture#3-of ? extends Object[]> is not applicable for the arguments (Object[])\n" + 
24728
		"----------\n" + 
24728
		"----------\n" + 
24729
		"2. ERROR in X.java (at line 16)\n" + 
24729
		"2. ERROR in X.java (at line 16)\n" + 
24730
		"	y.foo(c);\n" + 
24730
		"	y.foo(c);\n" + 
24731
		"	  ^^^\n" + 
24731
		"	  ^^^\n" + 
24732
		"The method foo(capture-of ? extends Cloneable) in the type Y<capture-of ? extends Cloneable> is not applicable for the arguments (Cloneable)\n" + 
24732
		"The method foo(capture#4-of ? extends Cloneable) in the type Y<capture#4-of ? extends Cloneable> is not applicable for the arguments (Cloneable)\n" + 
24733
		"----------\n");
24733
		"----------\n");
24734
}
24734
}
24735
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106936
24735
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106936
Lines 26036-26042 Link Here
26036
		"1. ERROR in X.java (at line 5)\n" + 
26036
		"1. ERROR in X.java (at line 5)\n" + 
26037
		"	bar(l.get(0));\n" + 
26037
		"	bar(l.get(0));\n" + 
26038
		"	^^^\n" + 
26038
		"	^^^\n" + 
26039
		"The method bar(String) in the type X is not applicable for the arguments (capture-of ? extends List<? extends Number>)\n" + 
26039
		"The method bar(String) in the type X is not applicable for the arguments (capture#1-of ? extends List<? extends Number>)\n" + 
26040
		"----------\n");
26040
		"----------\n");
26041
}
26041
}
26042
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=111689
26042
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=111689
Lines 26331-26337 Link Here
26331
		"1. ERROR in X.java (at line 7)\n" + 
26331
		"1. ERROR in X.java (at line 7)\n" + 
26332
		"	col.add(n);\n" + 
26332
		"	col.add(n);\n" + 
26333
		"	    ^^^\n" + 
26333
		"	    ^^^\n" + 
26334
		"The method add(capture-of ? extends Collection<? super Number>) in the type Collection<capture-of ? extends Collection<? super Number>> is not applicable for the arguments (List<Number>)\n" + 
26334
		"The method add(capture#1-of ? extends Collection<? super Number>) in the type Collection<capture#1-of ? extends Collection<? super Number>> is not applicable for the arguments (List<Number>)\n" + 
26335
		"----------\n");
26335
		"----------\n");
26336
}
26336
}
26337
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106451
26337
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106451
Lines 26357-26363 Link Here
26357
		"2. WARNING in X.java (at line 5)\n" + 
26357
		"2. WARNING in X.java (at line 5)\n" + 
26358
		"	List<Number> nums= (List<Number>) asList; // correct warning\n" + 
26358
		"	List<Number> nums= (List<Number>) asList; // correct warning\n" + 
26359
		"	                   ^^^^^^^^^^^^^^^^^^^^^\n" + 
26359
		"	                   ^^^^^^^^^^^^^^^^^^^^^\n" + 
26360
		"Type safety: The cast from Collection<capture-of ? extends Number> to List<Number> is actually checking against the erased type List\n" + 
26360
		"Type safety: The cast from Collection<capture#1-of ? extends Number> to List<Number> is actually checking against the erased type List\n" + 
26361
		"----------\n" + 
26361
		"----------\n" + 
26362
		"3. ERROR in X.java (at line 7)\n" + 
26362
		"3. ERROR in X.java (at line 7)\n" + 
26363
		"	Zork z;\n" + 
26363
		"	Zork z;\n" + 
Lines 27248-27259 Link Here
27248
		"			? uiMap.get(persistentClass)\n" + 
27248
		"			? uiMap.get(persistentClass)\n" + 
27249
		"			: (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" + 
27249
		"			: (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" + 
27250
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
27250
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
27251
		"Type mismatch: cannot convert from Class<capture-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" + 
27251
		"Type mismatch: cannot convert from Class<capture#4-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" + 
27252
		"----------\n" + 
27252
		"----------\n" + 
27253
		"4. WARNING in X.java (at line 12)\n" + 
27253
		"4. WARNING in X.java (at line 12)\n" + 
27254
		"	: (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" + 
27254
		"	: (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" + 
27255
		"	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
27255
		"	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
27256
		"Type safety: The cast from Class<capture-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>> is actually checking against the erased type Class\n" + 
27256
		"Type safety: The cast from Class<capture#2-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>> is actually checking against the erased type Class\n" + 
27257
		"----------\n");
27257
		"----------\n");
27258
}
27258
}
27259
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119395 - variation
27259
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119395 - variation
Lines 27298-27304 Link Here
27298
		"5. ERROR in X.java (at line 10)\n" + 
27298
		"5. ERROR in X.java (at line 10)\n" + 
27299
		"	Class<? extends Class<Object>> ceco2 = cec; // ko\n" + 
27299
		"	Class<? extends Class<Object>> ceco2 = cec; // ko\n" + 
27300
		"	                                       ^^^\n" + 
27300
		"	                                       ^^^\n" + 
27301
		"Type mismatch: cannot convert from Class<capture-of ? extends Class> to Class<? extends Class<Object>>\n" + 
27301
		"Type mismatch: cannot convert from Class<capture#2-of ? extends Class> to Class<? extends Class<Object>>\n" + 
27302
		"----------\n");
27302
		"----------\n");
27303
}
27303
}
27304
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119395 - variation
27304
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119395 - variation
Lines 27349-27355 Link Here
27349
		"6. WARNING in X.java (at line 7)\n" + 
27349
		"6. WARNING in X.java (at line 7)\n" + 
27350
		"	Class<Object> c = let.get(0); // ok - unchecked\n" + 
27350
		"	Class<Object> c = let.get(0); // ok - unchecked\n" + 
27351
		"	                  ^^^^^^^^^^\n" + 
27351
		"	                  ^^^^^^^^^^\n" + 
27352
		"Type safety: The expression of type capture-of ? extends T needs unchecked conversion to conform to Class<Object>\n" + 
27352
		"Type safety: The expression of type capture#1-of ? extends T needs unchecked conversion to conform to Class<Object>\n" + 
27353
		"----------\n" + 
27353
		"----------\n" + 
27354
		"7. WARNING in X.java (at line 9)\n" + 
27354
		"7. WARNING in X.java (at line 9)\n" + 
27355
		"	void bar3(List<? extends Class> lec) {\n" + 
27355
		"	void bar3(List<? extends Class> lec) {\n" + 
Lines 27359-27365 Link Here
27359
		"8. WARNING in X.java (at line 10)\n" + 
27359
		"8. WARNING in X.java (at line 10)\n" + 
27360
		"	Class<Object> c = lec.get(0); // ok - unchecked\n" + 
27360
		"	Class<Object> c = lec.get(0); // ok - unchecked\n" + 
27361
		"	                  ^^^^^^^^^^\n" + 
27361
		"	                  ^^^^^^^^^^\n" + 
27362
		"Type safety: The expression of type capture-of ? extends Class needs unchecked conversion to conform to Class<Object>\n" + 
27362
		"Type safety: The expression of type capture#2-of ? extends Class needs unchecked conversion to conform to Class<Object>\n" + 
27363
		"----------\n" + 
27363
		"----------\n" + 
27364
		"9. ERROR in X.java (at line 12)\n" + 
27364
		"9. ERROR in X.java (at line 12)\n" + 
27365
		"	Zork z;\n" + 
27365
		"	Zork z;\n" + 
Lines 27559-27575 Link Here
27559
		"1. ERROR in X.java (at line 7)\n" + 
27559
		"1. ERROR in X.java (at line 7)\n" + 
27560
		"	String s = getClass();\n" + 
27560
		"	String s = getClass();\n" + 
27561
		"	           ^^^^^^^^^^\n" + 
27561
		"	           ^^^^^^^^^^\n" + 
27562
		"Type mismatch: cannot convert from Class<capture-of ? extends X> to String\n" + 
27562
		"Type mismatch: cannot convert from Class<capture#1-of ? extends X> to String\n" + 
27563
		"----------\n" + 
27563
		"----------\n" + 
27564
		"2. ERROR in X.java (at line 8)\n" + 
27564
		"2. ERROR in X.java (at line 8)\n" + 
27565
		"	return (String) getDefault(getClass());\n" + 
27565
		"	return (String) getDefault(getClass());\n" + 
27566
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
27566
		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
27567
		"Cannot cast from capture-of ? extends X to String\n" + 
27567
		"Cannot cast from capture#2-of ? extends X to String\n" + 
27568
		"----------\n" + 
27568
		"----------\n" + 
27569
		"3. WARNING in X.java (at line 8)\n" + 
27569
		"3. WARNING in X.java (at line 8)\n" + 
27570
		"	return (String) getDefault(getClass());\n" + 
27570
		"	return (String) getDefault(getClass());\n" + 
27571
		"	                ^^^^^^^^^^^^^^^^^^^^^^\n" + 
27571
		"	                ^^^^^^^^^^^^^^^^^^^^^^\n" + 
27572
		"Type safety: Unchecked invocation getDefault(Class<capture-of ? extends X>) of the generic method getDefault(Class<T>) of type X<C>\n" + 
27572
		"Type safety: Unchecked invocation getDefault(Class<capture#2-of ? extends X>) of the generic method getDefault(Class<T>) of type X<C>\n" + 
27573
		"----------\n");
27573
		"----------\n");
27574
}
27574
}
27575
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=125445 
27575
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=125445 
Lines 28350-28361 Link Here
28350
		"4. ERROR in X.java (at line 13)\n" + 
28350
		"4. ERROR in X.java (at line 13)\n" + 
28351
		"	lc1 = lc3; //2 ko\n" + 
28351
		"	lc1 = lc3; //2 ko\n" + 
28352
		"	      ^^^\n" + 
28352
		"	      ^^^\n" + 
28353
		"Type mismatch: cannot convert from List<capture-of ? extends Collection<?>> to List<Collection>\n" + 
28353
		"Type mismatch: cannot convert from List<capture#1-of ? extends Collection<?>> to List<Collection>\n" + 
28354
		"----------\n" + 
28354
		"----------\n" + 
28355
		"5. ERROR in X.java (at line 14)\n" + 
28355
		"5. ERROR in X.java (at line 14)\n" + 
28356
		"	lc1 = lc4; //3 ko\n" + 
28356
		"	lc1 = lc4; //3 ko\n" + 
28357
		"	      ^^^\n" + 
28357
		"	      ^^^\n" + 
28358
		"Type mismatch: cannot convert from List<capture-of ? extends Collection> to List<Collection>\n" + 
28358
		"Type mismatch: cannot convert from List<capture#3-of ? extends Collection> to List<Collection>\n" + 
28359
		"----------\n" + 
28359
		"----------\n" + 
28360
		"6. ERROR in X.java (at line 15)\n" + 
28360
		"6. ERROR in X.java (at line 15)\n" + 
28361
		"	lc2 = lc1; //4 ko\n" + 
28361
		"	lc2 = lc1; //4 ko\n" + 
Lines 28365-28376 Link Here
28365
		"7. ERROR in X.java (at line 16)\n" + 
28365
		"7. ERROR in X.java (at line 16)\n" + 
28366
		"	lc2 = lc3; //5 ko\n" + 
28366
		"	lc2 = lc3; //5 ko\n" + 
28367
		"	      ^^^\n" + 
28367
		"	      ^^^\n" + 
28368
		"Type mismatch: cannot convert from List<capture-of ? extends Collection<?>> to List<Collection<?>>\n" + 
28368
		"Type mismatch: cannot convert from List<capture#4-of ? extends Collection<?>> to List<Collection<?>>\n" + 
28369
		"----------\n" + 
28369
		"----------\n" + 
28370
		"8. ERROR in X.java (at line 17)\n" + 
28370
		"8. ERROR in X.java (at line 17)\n" + 
28371
		"	lc2 = lc4; //6 ko\n" + 
28371
		"	lc2 = lc4; //6 ko\n" + 
28372
		"	      ^^^\n" + 
28372
		"	      ^^^\n" + 
28373
		"Type mismatch: cannot convert from List<capture-of ? extends Collection> to List<Collection<?>>\n" + 
28373
		"Type mismatch: cannot convert from List<capture#6-of ? extends Collection> to List<Collection<?>>\n" + 
28374
		"----------\n" + 
28374
		"----------\n" + 
28375
		"9. ERROR in X.java (at line 18)\n" + 
28375
		"9. ERROR in X.java (at line 18)\n" + 
28376
		"	lc3 = lc1; //7 ko\n" + 
28376
		"	lc3 = lc1; //7 ko\n" + 
Lines 28380-28386 Link Here
28380
		"10. ERROR in X.java (at line 20)\n" + 
28380
		"10. ERROR in X.java (at line 20)\n" + 
28381
		"	lc3 = lc4; //9 ko\n" + 
28381
		"	lc3 = lc4; //9 ko\n" + 
28382
		"	      ^^^\n" + 
28382
		"	      ^^^\n" + 
28383
		"Type mismatch: cannot convert from List<capture-of ? extends Collection> to List<? extends Collection<?>>\n" + 
28383
		"Type mismatch: cannot convert from List<capture#13-of ? extends Collection> to List<? extends Collection<?>>\n" + 
28384
		"----------\n" + 
28384
		"----------\n" + 
28385
		"11. WARNING in X.java (at line 25)\n" + 
28385
		"11. WARNING in X.java (at line 25)\n" + 
28386
		"	private final List<Collection> aList = new ArrayList<Collection>();\n" + 
28386
		"	private final List<Collection> aList = new ArrayList<Collection>();\n" + 
Lines 28447-28458 Link Here
28447
		"4. ERROR in X.java (at line 12)\n" + 
28447
		"4. ERROR in X.java (at line 12)\n" + 
28448
		"	lc1 = lc3; //2 ko\n" + 
28448
		"	lc1 = lc3; //2 ko\n" + 
28449
		"	      ^^^\n" + 
28449
		"	      ^^^\n" + 
28450
		"Type mismatch: cannot convert from List<capture-of ? super Collection<?>> to List<Collection>\n" + 
28450
		"Type mismatch: cannot convert from List<capture#1-of ? super Collection<?>> to List<Collection>\n" + 
28451
		"----------\n" + 
28451
		"----------\n" + 
28452
		"5. ERROR in X.java (at line 13)\n" + 
28452
		"5. ERROR in X.java (at line 13)\n" + 
28453
		"	lc1 = lc4; //3 ko\n" + 
28453
		"	lc1 = lc4; //3 ko\n" + 
28454
		"	      ^^^\n" + 
28454
		"	      ^^^\n" + 
28455
		"Type mismatch: cannot convert from List<capture-of ? super Collection> to List<Collection>\n" + 
28455
		"Type mismatch: cannot convert from List<capture#2-of ? super Collection> to List<Collection>\n" + 
28456
		"----------\n" + 
28456
		"----------\n" + 
28457
		"6. ERROR in X.java (at line 14)\n" + 
28457
		"6. ERROR in X.java (at line 14)\n" + 
28458
		"	lc2 = lc1; //4 ko\n" + 
28458
		"	lc2 = lc1; //4 ko\n" + 
Lines 28462-28473 Link Here
28462
		"7. ERROR in X.java (at line 15)\n" + 
28462
		"7. ERROR in X.java (at line 15)\n" + 
28463
		"	lc2 = lc3; //5 ko\n" + 
28463
		"	lc2 = lc3; //5 ko\n" + 
28464
		"	      ^^^\n" + 
28464
		"	      ^^^\n" + 
28465
		"Type mismatch: cannot convert from List<capture-of ? super Collection<?>> to List<Collection<?>>\n" + 
28465
		"Type mismatch: cannot convert from List<capture#3-of ? super Collection<?>> to List<Collection<?>>\n" + 
28466
		"----------\n" + 
28466
		"----------\n" + 
28467
		"8. ERROR in X.java (at line 16)\n" + 
28467
		"8. ERROR in X.java (at line 16)\n" + 
28468
		"	lc2 = lc4; //6 ko\n" + 
28468
		"	lc2 = lc4; //6 ko\n" + 
28469
		"	      ^^^\n" + 
28469
		"	      ^^^\n" + 
28470
		"Type mismatch: cannot convert from List<capture-of ? super Collection> to List<Collection<?>>\n" + 
28470
		"Type mismatch: cannot convert from List<capture#4-of ? super Collection> to List<Collection<?>>\n" + 
28471
		"----------\n" + 
28471
		"----------\n" + 
28472
		"9. ERROR in X.java (at line 21)\n" + 
28472
		"9. ERROR in X.java (at line 21)\n" + 
28473
		"	lc4 = lc2; //11 ko\n" + 
28473
		"	lc4 = lc2; //11 ko\n" + 
Lines 28477-28483 Link Here
28477
		"10. ERROR in X.java (at line 22)\n" + 
28477
		"10. ERROR in X.java (at line 22)\n" + 
28478
		"	lc4 = lc3; //12 ko\n" + 
28478
		"	lc4 = lc3; //12 ko\n" + 
28479
		"	      ^^^\n" + 
28479
		"	      ^^^\n" + 
28480
		"Type mismatch: cannot convert from List<capture-of ? super Collection<?>> to List<? super Collection>\n" + 
28480
		"Type mismatch: cannot convert from List<capture#12-of ? super Collection<?>> to List<? super Collection>\n" + 
28481
		"----------\n");
28481
		"----------\n");
28482
}
28482
}
28483
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
28483
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
Lines 28503-28509 Link Here
28503
		"2. ERROR in X.java (at line 6)\n" + 
28503
		"2. ERROR in X.java (at line 6)\n" + 
28504
		"	l2 = l1;\n" + 
28504
		"	l2 = l1;\n" + 
28505
		"	     ^^\n" + 
28505
		"	     ^^\n" + 
28506
		"Type mismatch: cannot convert from List<capture-of ? extends Collection<String>[]> to List<Collection[]>\n" + 
28506
		"Type mismatch: cannot convert from List<capture#2-of ? extends Collection<String>[]> to List<Collection[]>\n" + 
28507
		"----------\n");
28507
		"----------\n");
28508
}
28508
}
28509
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
28509
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
Lines 28542-28553 Link Here
28542
		"2. ERROR in X.java (at line 9)\n" + 
28542
		"2. ERROR in X.java (at line 9)\n" + 
28543
		"	lc1 = lc3; //2 ko\n" + 
28543
		"	lc1 = lc3; //2 ko\n" + 
28544
		"	      ^^^\n" + 
28544
		"	      ^^^\n" + 
28545
		"Type mismatch: cannot convert from List<capture-of ? extends Collection<?>[]> to List<Collection[]>\n" + 
28545
		"Type mismatch: cannot convert from List<capture#1-of ? extends Collection<?>[]> to List<Collection[]>\n" + 
28546
		"----------\n" + 
28546
		"----------\n" + 
28547
		"3. ERROR in X.java (at line 10)\n" + 
28547
		"3. ERROR in X.java (at line 10)\n" + 
28548
		"	lc1 = lc4; //3 ko\n" + 
28548
		"	lc1 = lc4; //3 ko\n" + 
28549
		"	      ^^^\n" + 
28549
		"	      ^^^\n" + 
28550
		"Type mismatch: cannot convert from List<capture-of ? extends Collection[]> to List<Collection[]>\n" + 
28550
		"Type mismatch: cannot convert from List<capture#2-of ? extends Collection[]> to List<Collection[]>\n" + 
28551
		"----------\n" + 
28551
		"----------\n" + 
28552
		"4. ERROR in X.java (at line 11)\n" + 
28552
		"4. ERROR in X.java (at line 11)\n" + 
28553
		"	lc2 = lc1; //4 ko\n" + 
28553
		"	lc2 = lc1; //4 ko\n" + 
Lines 28557-28568 Link Here
28557
		"5. ERROR in X.java (at line 12)\n" + 
28557
		"5. ERROR in X.java (at line 12)\n" + 
28558
		"	lc2 = lc3; //5 ko\n" + 
28558
		"	lc2 = lc3; //5 ko\n" + 
28559
		"	      ^^^\n" + 
28559
		"	      ^^^\n" + 
28560
		"Type mismatch: cannot convert from List<capture-of ? extends Collection<?>[]> to List<Collection<?>[]>\n" + 
28560
		"Type mismatch: cannot convert from List<capture#3-of ? extends Collection<?>[]> to List<Collection<?>[]>\n" + 
28561
		"----------\n" + 
28561
		"----------\n" + 
28562
		"6. ERROR in X.java (at line 13)\n" + 
28562
		"6. ERROR in X.java (at line 13)\n" + 
28563
		"	lc2 = lc4; //6 ko\n" + 
28563
		"	lc2 = lc4; //6 ko\n" + 
28564
		"	      ^^^\n" + 
28564
		"	      ^^^\n" + 
28565
		"Type mismatch: cannot convert from List<capture-of ? extends Collection[]> to List<Collection<?>[]>\n" + 
28565
		"Type mismatch: cannot convert from List<capture#4-of ? extends Collection[]> to List<Collection<?>[]>\n" + 
28566
		"----------\n" + 
28566
		"----------\n" + 
28567
		"7. ERROR in X.java (at line 14)\n" + 
28567
		"7. ERROR in X.java (at line 14)\n" + 
28568
		"	lc3 = lc1; //7 ko\n" + 
28568
		"	lc3 = lc1; //7 ko\n" + 
Lines 28572-28578 Link Here
28572
		"8. ERROR in X.java (at line 16)\n" + 
28572
		"8. ERROR in X.java (at line 16)\n" + 
28573
		"	lc3 = lc4; //9 ko\n" + 
28573
		"	lc3 = lc4; //9 ko\n" + 
28574
		"	      ^^^\n" + 
28574
		"	      ^^^\n" + 
28575
		"Type mismatch: cannot convert from List<capture-of ? extends Collection[]> to List<? extends Collection<?>[]>\n" + 
28575
		"Type mismatch: cannot convert from List<capture#8-of ? extends Collection[]> to List<? extends Collection<?>[]>\n" + 
28576
		"----------\n");
28576
		"----------\n");
28577
}
28577
}
28578
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
28578
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
Lines 28611-28622 Link Here
28611
		"2. ERROR in X.java (at line 9)\n" + 
28611
		"2. ERROR in X.java (at line 9)\n" + 
28612
		"	lc1 = lc3; //2 ko\n" + 
28612
		"	lc1 = lc3; //2 ko\n" + 
28613
		"	      ^^^\n" + 
28613
		"	      ^^^\n" + 
28614
		"Type mismatch: cannot convert from List<capture-of ? super Collection<?>[]> to List<Collection[]>\n" + 
28614
		"Type mismatch: cannot convert from List<capture#1-of ? super Collection<?>[]> to List<Collection[]>\n" + 
28615
		"----------\n" + 
28615
		"----------\n" + 
28616
		"3. ERROR in X.java (at line 10)\n" + 
28616
		"3. ERROR in X.java (at line 10)\n" + 
28617
		"	lc1 = lc4; //3 ko\n" + 
28617
		"	lc1 = lc4; //3 ko\n" + 
28618
		"	      ^^^\n" + 
28618
		"	      ^^^\n" + 
28619
		"Type mismatch: cannot convert from List<capture-of ? super Collection[]> to List<Collection[]>\n" + 
28619
		"Type mismatch: cannot convert from List<capture#2-of ? super Collection[]> to List<Collection[]>\n" + 
28620
		"----------\n" + 
28620
		"----------\n" + 
28621
		"4. ERROR in X.java (at line 11)\n" + 
28621
		"4. ERROR in X.java (at line 11)\n" + 
28622
		"	lc2 = lc1; //4 ko\n" + 
28622
		"	lc2 = lc1; //4 ko\n" + 
Lines 28626-28637 Link Here
28626
		"5. ERROR in X.java (at line 12)\n" + 
28626
		"5. ERROR in X.java (at line 12)\n" + 
28627
		"	lc2 = lc3; //5 ko\n" + 
28627
		"	lc2 = lc3; //5 ko\n" + 
28628
		"	      ^^^\n" + 
28628
		"	      ^^^\n" + 
28629
		"Type mismatch: cannot convert from List<capture-of ? super Collection<?>[]> to List<Collection<?>[]>\n" + 
28629
		"Type mismatch: cannot convert from List<capture#3-of ? super Collection<?>[]> to List<Collection<?>[]>\n" + 
28630
		"----------\n" + 
28630
		"----------\n" + 
28631
		"6. ERROR in X.java (at line 13)\n" + 
28631
		"6. ERROR in X.java (at line 13)\n" + 
28632
		"	lc2 = lc4; //6 ko\n" + 
28632
		"	lc2 = lc4; //6 ko\n" + 
28633
		"	      ^^^\n" + 
28633
		"	      ^^^\n" + 
28634
		"Type mismatch: cannot convert from List<capture-of ? super Collection[]> to List<Collection<?>[]>\n" + 
28634
		"Type mismatch: cannot convert from List<capture#4-of ? super Collection[]> to List<Collection<?>[]>\n" + 
28635
		"----------\n" + 
28635
		"----------\n" + 
28636
		"7. ERROR in X.java (at line 18)\n" + 
28636
		"7. ERROR in X.java (at line 18)\n" + 
28637
		"	lc4 = lc2; //11 ko\n" + 
28637
		"	lc4 = lc2; //11 ko\n" + 
Lines 28641-28647 Link Here
28641
		"8. ERROR in X.java (at line 19)\n" + 
28641
		"8. ERROR in X.java (at line 19)\n" + 
28642
		"	lc4 = lc3; //12 ko		\n" + 
28642
		"	lc4 = lc3; //12 ko		\n" + 
28643
		"	      ^^^\n" + 
28643
		"	      ^^^\n" + 
28644
		"Type mismatch: cannot convert from List<capture-of ? super Collection<?>[]> to List<? super Collection[]>\n" + 
28644
		"Type mismatch: cannot convert from List<capture#12-of ? super Collection<?>[]> to List<? super Collection[]>\n" + 
28645
		"----------\n");
28645
		"----------\n");
28646
}
28646
}
28647
28647
Lines 28966-28974 Link Here
28966
		"1. ERROR in X.java (at line 6)\n" + 
28966
		"1. ERROR in X.java (at line 6)\n" + 
28967
		"	X.a(t.getClass());\n" + 
28967
		"	X.a(t.getClass());\n" + 
28968
		"	  ^\n" + 
28968
		"	  ^\n" + 
28969
		"The method a(Class<? extends X<?>>) in the type X is not applicable for the arguments (Class<capture-of ? extends X>)\n" + 
28969
		"The method a(Class<? extends X<?>>) in the type X is not applicable for the arguments (Class<capture#2-of ? extends X>)\n" + 
28970
		"----------\n"
28970
		"----------\n");
28971
	);
28972
}
28971
}
28973
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=129190 
28972
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=129190 
28974
public void test0924() {
28973
public void test0924() {
Lines 29092-29098 Link Here
29092
		"1. ERROR in X.java (at line 6)\n" + 
29091
		"1. ERROR in X.java (at line 6)\n" + 
29093
		"	RESULT = NonTerminalSourcePart.create(Tuple.create(true, t.value().fst()));\n" + 
29092
		"	RESULT = NonTerminalSourcePart.create(Tuple.create(true, t.value().fst()));\n" + 
29094
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29093
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29095
		"Type mismatch: cannot convert from NonTerminalSourcePart<Tuple<Boolean,capture-of ? extends Term>> to NonTerminalSourcePart<? extends Tuple<Boolean,Term>>\n" + 
29094
		"Type mismatch: cannot convert from NonTerminalSourcePart<Tuple<Boolean,capture#3-of ? extends Term>> to NonTerminalSourcePart<? extends Tuple<Boolean,Term>>\n" + 
29096
		"----------\n");
29095
		"----------\n");
29097
}
29096
}
29098
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
29097
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
Lines 29133-29159 Link Here
29133
		"1. ERROR in X.java (at line 6)\n" + 
29132
		"1. ERROR in X.java (at line 6)\n" + 
29134
		"	RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" + 
29133
		"	RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" + 
29135
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29134
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29136
		"Type mismatch: cannot convert from List<List<capture-of ? extends Object>> to List<? extends List<Object>>\n" + 
29135
		"Type mismatch: cannot convert from List<List<capture#2-of ? extends Object>> to List<? extends List<Object>>\n" + 
29137
		"----------\n" + 
29136
		"----------\n" + 
29138
		"2. ERROR in X.java (at line 11)\n" + 
29137
		"2. ERROR in X.java (at line 11)\n" + 
29139
		"	RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" + 
29138
		"	RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" + 
29140
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29139
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29141
		"Type mismatch: cannot convert from List<List<capture-of ? extends Object>> to List<List<Object>>\n" + 
29140
		"Type mismatch: cannot convert from List<List<capture#3-of ? extends Object>> to List<List<Object>>\n" + 
29142
		"----------\n" + 
29141
		"----------\n" + 
29143
		"3. ERROR in X.java (at line 16)\n" + 
29142
		"3. ERROR in X.java (at line 16)\n" + 
29144
		"	RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" + 
29143
		"	RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" + 
29145
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29144
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29146
		"Type mismatch: cannot convert from List<List<capture-of ?>> to List<List<Object>>\n" + 
29145
		"Type mismatch: cannot convert from List<List<capture#4-of ?>> to List<List<Object>>\n" + 
29147
		"----------\n" + 
29146
		"----------\n" + 
29148
		"4. ERROR in X.java (at line 20)\n" + 
29147
		"4. ERROR in X.java (at line 20)\n" + 
29149
		"	RESULT = lst;\n" + 
29148
		"	RESULT = lst;\n" + 
29150
		"	         ^^^\n" + 
29149
		"	         ^^^\n" + 
29151
		"Type mismatch: cannot convert from List<capture-of ? extends Object> to List<Object>\n" + 
29150
		"Type mismatch: cannot convert from List<capture#5-of ? extends Object> to List<Object>\n" + 
29152
		"----------\n" + 
29151
		"----------\n" + 
29153
		"5. ERROR in X.java (at line 21)\n" + 
29152
		"5. ERROR in X.java (at line 21)\n" + 
29154
		"	RESULT = Collections.singletonList(lst.get(0));\n" + 
29153
		"	RESULT = Collections.singletonList(lst.get(0));\n" + 
29155
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29154
		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
29156
		"Type mismatch: cannot convert from List<capture-of ? extends Object> to List<Object>\n" + 
29155
		"Type mismatch: cannot convert from List<capture#6-of ? extends Object> to List<Object>\n" + 
29157
		"----------\n");
29156
		"----------\n");
29158
}
29157
}
29159
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
29158
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
Lines 29174-29180 Link Here
29174
		"1. ERROR in X.java (at line 6)\n" + 
29173
		"1. ERROR in X.java (at line 6)\n" + 
29175
		"	x1.addAll(x2);\n" + 
29174
		"	x1.addAll(x2);\n" + 
29176
		"	   ^^^^^^\n" + 
29175
		"	   ^^^^^^\n" + 
29177
		"The method addAll(Collection<? extends capture-of ?>) in the type List<capture-of ?> is not applicable for the arguments (List<capture-of ?>)\n" + 
29176
		"The method addAll(Collection<? extends capture#1-of ?>) in the type List<capture#1-of ?> is not applicable for the arguments (List<capture#2-of ?>)\n" + 
29178
		"----------\n");
29177
		"----------\n");
29179
}
29178
}
29180
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117119
29179
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=117119
Lines 29208-29219 Link Here
29208
		"2. WARNING in X.java (at line 7)\n" + 
29207
		"2. WARNING in X.java (at line 7)\n" + 
29209
		"	final Collection<E> test = allOf(enumType);\n" + 
29208
		"	final Collection<E> test = allOf(enumType);\n" + 
29210
		"	                           ^^^^^^^^^^^^^^^\n" + 
29209
		"	                           ^^^^^^^^^^^^^^^\n" + 
29211
		"Type safety: Unchecked invocation allOf(Class<capture-of ? extends Enum>) of the generic method allOf(Class<E>) of type X\n" + 
29210
		"Type safety: Unchecked invocation allOf(Class<capture#1-of ? extends Enum>) of the generic method allOf(Class<E>) of type X\n" + 
29212
		"----------\n" + 
29211
		"----------\n" + 
29213
		"3. ERROR in X.java (at line 7)\n" + 
29212
		"3. ERROR in X.java (at line 7)\n" + 
29214
		"	final Collection<E> test = allOf(enumType);\n" + 
29213
		"	final Collection<E> test = allOf(enumType);\n" + 
29215
		"	                           ^^^^^^^^^^^^^^^\n" + 
29214
		"	                           ^^^^^^^^^^^^^^^\n" + 
29216
		"Type mismatch: cannot convert from Collection<capture-of ? extends Enum> to Collection<E>\n" + 
29215
		"Type mismatch: cannot convert from Collection<capture#1-of ? extends Enum> to Collection<E>\n" + 
29217
		"----------\n" + 
29216
		"----------\n" + 
29218
		"4. WARNING in X.java (at line 9)\n" + 
29217
		"4. WARNING in X.java (at line 9)\n" + 
29219
		"	Collection<? extends Enum> colType = null;\n" + 
29218
		"	Collection<? extends Enum> colType = null;\n" + 
Lines 29223-29229 Link Here
29223
		"5. ERROR in X.java (at line 10)\n" + 
29222
		"5. ERROR in X.java (at line 10)\n" + 
29224
		"	final Collection<E> test2 = colType;\n" + 
29223
		"	final Collection<E> test2 = colType;\n" + 
29225
		"	                            ^^^^^^^\n" + 
29224
		"	                            ^^^^^^^\n" + 
29226
		"Type mismatch: cannot convert from Collection<capture-of ? extends Enum> to Collection<E>\n" + 
29225
		"Type mismatch: cannot convert from Collection<capture#2-of ? extends Enum> to Collection<E>\n" + 
29227
		"----------\n");
29226
		"----------\n");
29228
}
29227
}
29229
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119238
29228
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=119238
Lines 29780-29786 Link Here
29780
		"1. ERROR in X.java (at line 4)\n" + 
29779
		"1. ERROR in X.java (at line 4)\n" + 
29781
		"	Box<Runnable> bx = box(b.element);\n" + 
29780
		"	Box<Runnable> bx = box(b.element);\n" + 
29782
		"	                   ^^^^^^^^^^^^^^\n" + 
29781
		"	                   ^^^^^^^^^^^^^^\n" + 
29783
		"Type mismatch: cannot convert from Box<capture-of ?> to Box<Runnable>\n" + 
29782
		"Type mismatch: cannot convert from Box<capture#1-of ?> to Box<Runnable>\n" + 
29784
		"----------\n");
29783
		"----------\n");
29785
}
29784
}
29786
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
29785
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
Lines 31029-31035 Link Here
31029
			"1. ERROR in X.java (at line 7)\n" + 
31028
			"1. ERROR in X.java (at line 7)\n" + 
31030
			"	l1.addAll(l2);\n" + 
31029
			"	l1.addAll(l2);\n" + 
31031
			"	   ^^^^^^\n" + 
31030
			"	   ^^^^^^\n" + 
31032
			"The method addAll(Collection<? extends capture-of ?>) in the type List<capture-of ?> is not applicable for the arguments (List<capture-of ?>)\n" + 
31031
			"The method addAll(Collection<? extends capture#1-of ?>) in the type List<capture#1-of ?> is not applicable for the arguments (List<capture#2-of ?>)\n" + 
31033
			"----------\n");
31032
			"----------\n");
31034
}
31033
}
31035
// generic inner class within a non generic one
31034
// generic inner class within a non generic one
Lines 31831-31837 Link Here
31831
		"1. ERROR in GenericsProblem.java (at line 5)\n" + 
31830
		"1. ERROR in GenericsProblem.java (at line 5)\n" + 
31832
		"	Class<? extends T> cl = val.getClass();\n" + 
31831
		"	Class<? extends T> cl = val.getClass();\n" + 
31833
		"	                        ^^^^^^^^^^^^^^\n" + 
31832
		"	                        ^^^^^^^^^^^^^^\n" + 
31834
		"Type mismatch: cannot convert from Class<capture-of ? extends Object> to Class<? extends T>\n" + 
31833
		"Type mismatch: cannot convert from Class<capture#2-of ? extends Object> to Class<? extends T>\n" + 
31835
		"----------\n");
31834
		"----------\n");
31836
}
31835
}
31837
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061
31836
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061
Lines 32337-32340 Link Here
32337
		"The method deepToString(T[]) in the type X is not applicable for the arguments (double[])\n" + 
32336
		"The method deepToString(T[]) in the type X is not applicable for the arguments (double[])\n" + 
32338
		"----------\n");
32337
		"----------\n");
32339
}
32338
}
32339
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=149573
32340
public void test1020() {
32341
	this.runNegativeTest(
32342
		new String[] {
32343
			"X.java",
32344
			"import java.util.List;\n" + 
32345
			"\n" + 
32346
			"public class X {\n" + 
32347
			"	void foo(List<? extends Exception> l1, List<? extends Exception> l2) {\n" + 
32348
			"		l1.add(l2.get(0));\n" + 
32349
			"	}\n" + 
32350
			"}\n", // =================
32351
		},
32352
		"----------\n" + 
32353
		"1. ERROR in X.java (at line 5)\n" + 
32354
		"	l1.add(l2.get(0));\n" + 
32355
		"	   ^^^\n" + 
32356
		"The method add(capture#1-of ? extends Exception) in the type List<capture#1-of ? extends Exception> is not applicable for the arguments (capture#2-of ? extends Exception)\n" + 
32357
		"----------\n");
32358
}
32340
}
32359
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (-2 / +2 lines)
Lines 2043-2049 Link Here
2043
	        "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2043
	        "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2044
	        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2044
	        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2045
	        "	                     ^^^^^^^^^^^^^^^^^^^^^^\n" + 
2045
	        "	                     ^^^^^^^^^^^^^^^^^^^^^^\n" + 
2046
	        "Type safety: The cast from X.XX<capture-of ?,capture-of ?> to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2046
	        "Type safety: The cast from X.XX<capture#22-of ?,capture#23-of ?> to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" +
2047
	        "----------\n" + 
2047
	        "----------\n" + 
2048
	        "5 problems (5 warnings)",
2048
	        "5 problems (5 warnings)",
2049
	        true);
2049
	        true);
Lines 2208-2214 Link Here
2208
        "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2208
        "5. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/p/Z.java (at line 58)\n" + 
2209
        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2209
        "	final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
2210
        "	                     ^^^^^^^^^^^^^^^^^^^^^^\n" + 
2210
        "	                     ^^^^^^^^^^^^^^^^^^^^^^\n" + 
2211
        "Type safety: The cast from X.XX<capture-of ?,capture-of ?> to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2211
        "Type safety: The cast from X.XX<capture#22-of ?,capture#23-of ?> to X.XX<?,X.XY> is actually checking against the erased type X<T,U,V>.XX\n" + 
2212
        "----------\n" + 
2212
        "----------\n" + 
2213
        "5 problems (5 warnings)",
2213
        "5 problems (5 warnings)",
2214
        false);
2214
        false);
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java (-1 / +1 lines)
Lines 3088-3094 Link Here
3088
			"3. WARNING in X.java (at line 20)\n" + 
3088
			"3. WARNING in X.java (at line 20)\n" + 
3089
			"	final long t4 = obj.getVal();\n" + 
3089
			"	final long t4 = obj.getVal();\n" + 
3090
			"	                ^^^^^^^^^^^^\n" + 
3090
			"	                ^^^^^^^^^^^^\n" + 
3091
			"The expression of type capture-of ? extends Long is unboxed into long\n" + 
3091
			"The expression of type capture#2-of ? extends Long is unboxed into long\n" + 
3092
			"----------\n" + 
3092
			"----------\n" + 
3093
			"4. WARNING in X.java (at line 24)\n" + 
3093
			"4. WARNING in X.java (at line 24)\n" + 
3094
			"	<U extends Long> void proc2(Cla<U> obj) {\n" + 
3094
			"	<U extends Long> void proc2(Cla<U> obj) {\n" + 

Return to bug 149573