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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+53 lines)
Lines 44270-44273 Link Here
44270
			},
44270
			},
44271
			"");
44271
			"");
44272
}
44272
}
44273
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231861
44274
public void test1330() {
44275
	this.runConformTest(
44276
			new String[] {
44277
				"p/BaseValue.java", // =================
44278
				"package p;\n" + 
44279
				"interface Value<B> {}\n" + 
44280
				"public class BaseValue<B> implements Value<B> {}\n",
44281
				"p/Model.java", // =================
44282
				"package p;\n" + 
44283
				"public class Model {\n" + 
44284
				"  public java.util.Map<String, Value> map = new java.util.LinkedHashMap<String,Value>();\n" + 
44285
				"}\n", // =================
44286
			},
44287
			"");
44288
	this.runConformTest(
44289
			new String[] {
44290
				"p2/Person.java", // =================
44291
				"package p2;\n" + 
44292
				"public class Person extends p.Model {\n" + 
44293
				"        void test() {\n" + 
44294
				"                this.map.put(\"name\", new p.BaseValue<String>());\n" + 
44295
				"        }\n" + 
44296
				"}\n", // =================
44297
			},
44298
			"",
44299
			null,
44300
			false,
44301
			null);	
44302
}
44303
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231861 - variation
44304
public void test1331() {
44305
	this.runConformTest(
44306
			new String[] {
44307
				"p/BaseValue.java", // =================
44308
				"package p;\n" + 
44309
				"interface Value<B> {}\n" + 
44310
				"public class BaseValue<B> implements Value<B> {}\n",
44311
				"p/Model.java", // =================
44312
				"package p;\n" + 
44313
				"public class Model {\n" + 
44314
				"  public java.util.Map<String, Value> map = new java.util.LinkedHashMap<String,Value>();\n" + 
44315
				"}\n",
44316
				"p2/Person.java", // =================
44317
				"package p2;\n" + 
44318
				"public class Person extends p.Model {\n" + 
44319
				"        void test() {\n" + 
44320
				"                this.map.put(\"name\", new p.BaseValue<String>());\n" + 
44321
				"        }\n" + 
44322
				"}\n", // =================
44323
			},
44324
			"");
44325
}
44273
}
44326
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java (-3 / +7 lines)
Lines 310-316 Link Here
310
	 */
310
	 */
311
	public String debugName() {
311
	public String debugName() {
312
	    StringBuffer nameBuffer = new StringBuffer(10);
312
	    StringBuffer nameBuffer = new StringBuffer(10);
313
		nameBuffer.append(this.type.sourceName());
313
	    if (this.type instanceof UnresolvedReferenceBinding) {
314
	    	nameBuffer.append(this.type);
315
	    } else {
316
			nameBuffer.append(this.type.sourceName());
317
	    }
314
		if (this.arguments != null) {
318
		if (this.arguments != null) {
315
			nameBuffer.append('<');
319
			nameBuffer.append('<');
316
		    for (int i = 0, length = this.arguments.length; i < length; i++) {
320
		    for (int i = 0, length = this.arguments.length; i < length; i++) {
Lines 830-836 Link Here
830
		if (this.arguments != null) {
834
		if (this.arguments != null) {
831
			int argLength = this.arguments.length;
835
			int argLength = this.arguments.length;
832
			for (int i = 0; i < argLength; i++)
836
			for (int i = 0; i < argLength; i++)
833
				this.arguments[i] = BinaryTypeBinding.resolveType(this.arguments[i], this.environment, this, i);
837
				this.arguments[i] = BinaryTypeBinding.resolveType(this.arguments[i], this.environment, null, 0);
834
			// arity check
838
			// arity check
835
			TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables();
839
			TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables();
836
			if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic
840
			if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic
Lines 988-994 Link Here
988
	public String toString() {
992
	public String toString() {
989
	    StringBuffer buffer = new StringBuffer(30);
993
	    StringBuffer buffer = new StringBuffer(30);
990
	    if (this.type instanceof UnresolvedReferenceBinding) {
994
	    if (this.type instanceof UnresolvedReferenceBinding) {
991
	    	buffer.append(this.type);
995
	    	buffer.append(this.debugName());
992
	    } else {
996
	    } else {
993
			if (isDeprecated()) buffer.append("deprecated "); //$NON-NLS-1$
997
			if (isDeprecated()) buffer.append("deprecated "); //$NON-NLS-1$
994
			if (isPublic()) buffer.append("public "); //$NON-NLS-1$
998
			if (isPublic()) buffer.append("public "); //$NON-NLS-1$

Return to bug 231861