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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java (-64 / +72 lines)
Lines 283-289 Link Here
283
	 */
283
	 */
284
	public String debugName() {
284
	public String debugName() {
285
	    StringBuffer nameBuffer = new StringBuffer(10);
285
	    StringBuffer nameBuffer = new StringBuffer(10);
286
		nameBuffer.append(this.type.sourceName());
286
	    if (this.type instanceof UnresolvedReferenceBinding) {
287
	    	nameBuffer.append(this.type);
288
	    } else {
289
			nameBuffer.append(this.type.sourceName());
290
	    }
287
		if (this.arguments != null) {
291
		if (this.arguments != null) {
288
			nameBuffer.append('<');
292
			nameBuffer.append('<');
289
		    for (int i = 0, length = this.arguments.length; i < length; i++) {
293
		    for (int i = 0, length = this.arguments.length; i < length; i++) {
Lines 858-864 Link Here
858
		if (this.arguments != null) {
862
		if (this.arguments != null) {
859
			int argLength = this.arguments.length;
863
			int argLength = this.arguments.length;
860
			for (int i = 0; i < argLength; i++)
864
			for (int i = 0; i < argLength; i++)
861
				BinaryTypeBinding.resolveType(this.arguments[i], this.environment, this, i);
865
				BinaryTypeBinding.resolveType(this.arguments[i], this.environment, null, 0);
862
			// arity check
866
			// arity check
863
			TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables();
867
			TypeVariableBinding[] refTypeVariables = resolvedType.typeVariables();
864
			if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic
868
			if (refTypeVariables == Binding.NO_TYPE_VARIABLES) { // check generic
Lines 1013-1084 Link Here
1013
	 */
1017
	 */
1014
	public String toString() {
1018
	public String toString() {
1015
	    StringBuffer buffer = new StringBuffer(30);
1019
	    StringBuffer buffer = new StringBuffer(30);
1016
		if (isDeprecated()) buffer.append("deprecated "); //$NON-NLS-1$
1020
	    if (this.type instanceof UnresolvedReferenceBinding) {
1017
		if (isPublic()) buffer.append("public "); //$NON-NLS-1$
1021
	    	buffer.append(this.debugName());
1018
		if (isProtected()) buffer.append("protected "); //$NON-NLS-1$
1022
	    } else {
1019
		if (isPrivate()) buffer.append("private "); //$NON-NLS-1$
1023
			if (isDeprecated()) buffer.append("deprecated "); //$NON-NLS-1$
1020
		if (isAbstract() && isClass()) buffer.append("abstract "); //$NON-NLS-1$
1024
			if (isPublic()) buffer.append("public "); //$NON-NLS-1$
1021
		if (isStatic() && isNestedType()) buffer.append("static "); //$NON-NLS-1$
1025
			if (isProtected()) buffer.append("protected "); //$NON-NLS-1$
1022
		if (isFinal()) buffer.append("final "); //$NON-NLS-1$
1026
			if (isPrivate()) buffer.append("private "); //$NON-NLS-1$
1023
	
1027
			if (isAbstract() && isClass()) buffer.append("abstract "); //$NON-NLS-1$
1024
		if (isEnum()) buffer.append("enum "); //$NON-NLS-1$
1028
			if (isStatic() && isNestedType()) buffer.append("static "); //$NON-NLS-1$
1025
		else if (isAnnotationType()) buffer.append("@interface "); //$NON-NLS-1$
1029
			if (isFinal()) buffer.append("final "); //$NON-NLS-1$
1026
		else if (isClass()) buffer.append("class "); //$NON-NLS-1$
1030
		
1027
		else buffer.append("interface "); //$NON-NLS-1$
1031
			if (isEnum()) buffer.append("enum "); //$NON-NLS-1$
1028
		buffer.append(this.debugName());
1032
			else if (isAnnotationType()) buffer.append("@interface "); //$NON-NLS-1$
1029
	
1033
			else if (isClass()) buffer.append("class "); //$NON-NLS-1$
1030
		buffer.append("\n\textends "); //$NON-NLS-1$
1034
			else buffer.append("interface "); //$NON-NLS-1$
1031
		buffer.append((superclass != null) ? superclass.debugName() : "NULL TYPE"); //$NON-NLS-1$
1035
			buffer.append(this.debugName());
1032
	
1036
		
1033
		if (superInterfaces != null) {
1037
			buffer.append("\n\textends "); //$NON-NLS-1$
1034
			if (superInterfaces != Binding.NO_SUPERINTERFACES) {
1038
			buffer.append((superclass != null) ? superclass.debugName() : "NULL TYPE"); //$NON-NLS-1$
1035
				buffer.append("\n\timplements : "); //$NON-NLS-1$
1039
		
1036
				for (int i = 0, length = superInterfaces.length; i < length; i++) {
1040
			if (superInterfaces != null) {
1037
					if (i  > 0)
1041
				if (superInterfaces != Binding.NO_SUPERINTERFACES) {
1038
						buffer.append(", "); //$NON-NLS-1$
1042
					buffer.append("\n\timplements : "); //$NON-NLS-1$
1039
					buffer.append((superInterfaces[i] != null) ? superInterfaces[i].debugName() : "NULL TYPE"); //$NON-NLS-1$
1043
					for (int i = 0, length = superInterfaces.length; i < length; i++) {
1044
						if (i  > 0)
1045
							buffer.append(", "); //$NON-NLS-1$
1046
						buffer.append((superInterfaces[i] != null) ? superInterfaces[i].debugName() : "NULL TYPE"); //$NON-NLS-1$
1047
					}
1040
				}
1048
				}
1049
			} else {
1050
				buffer.append("NULL SUPERINTERFACES"); //$NON-NLS-1$
1041
			}
1051
			}
1042
		} else {
1052
		
1043
			buffer.append("NULL SUPERINTERFACES"); //$NON-NLS-1$
1053
			if (enclosingType() != null) {
1044
		}
1054
				buffer.append("\n\tenclosing type : "); //$NON-NLS-1$
1045
	
1055
				buffer.append(enclosingType().debugName());
1046
		if (enclosingType() != null) {
1047
			buffer.append("\n\tenclosing type : "); //$NON-NLS-1$
1048
			buffer.append(enclosingType().debugName());
1049
		}
1050
	
1051
		if (fields != null) {
1052
			if (fields != Binding.NO_FIELDS) {
1053
				buffer.append("\n/*   fields   */"); //$NON-NLS-1$
1054
				for (int i = 0, length = fields.length; i < length; i++)
1055
				    buffer.append('\n').append((fields[i] != null) ? fields[i].toString() : "NULL FIELD"); //$NON-NLS-1$ 
1056
			}
1056
			}
1057
		} else {
1057
		
1058
			buffer.append("NULL FIELDS"); //$NON-NLS-1$
1058
			if (fields != null) {
1059
		}
1059
				if (fields != Binding.NO_FIELDS) {
1060
	
1060
					buffer.append("\n/*   fields   */"); //$NON-NLS-1$
1061
		if (methods != null) {
1061
					for (int i = 0, length = fields.length; i < length; i++)
1062
			if (methods != Binding.NO_METHODS) {
1062
					    buffer.append('\n').append((fields[i] != null) ? fields[i].toString() : "NULL FIELD"); //$NON-NLS-1$ 
1063
				buffer.append("\n/*   methods   */"); //$NON-NLS-1$
1063
				}
1064
				for (int i = 0, length = methods.length; i < length; i++)
1064
			} else {
1065
					buffer.append('\n').append((methods[i] != null) ? methods[i].toString() : "NULL METHOD"); //$NON-NLS-1$
1065
				buffer.append("NULL FIELDS"); //$NON-NLS-1$
1066
			}
1066
			}
1067
		} else {
1067
		
1068
			buffer.append("NULL METHODS"); //$NON-NLS-1$
1068
			if (methods != null) {
1069
		}
1069
				if (methods != Binding.NO_METHODS) {
1070
	
1070
					buffer.append("\n/*   methods   */"); //$NON-NLS-1$
1071
//		if (memberTypes != null) {
1071
					for (int i = 0, length = methods.length; i < length; i++)
1072
//			if (memberTypes != NoMemberTypes) {
1072
						buffer.append('\n').append((methods[i] != null) ? methods[i].toString() : "NULL METHOD"); //$NON-NLS-1$
1073
//				buffer.append("\n/*   members   */");
1073
				}
1074
//				for (int i = 0, length = memberTypes.length; i < length; i++)
1074
			} else {
1075
//					buffer.append('\n').append((memberTypes[i] != null) ? memberTypes[i].toString() : "NULL TYPE");
1075
				buffer.append("NULL METHODS"); //$NON-NLS-1$
1076
//			}
1076
			}
1077
//		} else {
1077
		
1078
//			buffer.append("NULL MEMBER TYPES");
1078
	//		if (memberTypes != null) {
1079
//		}
1079
	//			if (memberTypes != NoMemberTypes) {
1080
	
1080
	//				buffer.append("\n/*   members   */");
1081
		buffer.append("\n\n"); //$NON-NLS-1$
1081
	//				for (int i = 0, length = memberTypes.length; i < length; i++)
1082
	//					buffer.append('\n').append((memberTypes[i] != null) ? memberTypes[i].toString() : "NULL TYPE");
1083
	//			}
1084
	//		} else {
1085
	//			buffer.append("NULL MEMBER TYPES");
1086
	//		}
1087
		
1088
			buffer.append("\n\n"); //$NON-NLS-1$
1089
	    }
1082
		return buffer.toString();
1090
		return buffer.toString();
1083
		
1091
		
1084
	}
1092
	}
(-)buildnotes_jdt-core.html (-1 / +3 lines)
Lines 55-61 Link Here
55
<h2>What's new in this drop</h2>
55
<h2>What's new in this drop</h2>
56
56
57
<h3>Problem Reports Fixed</h3>
57
<h3>Problem Reports Fixed</h3>
58
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=228291">228291</a>
58
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=231861">231861</a>
59
[1.5][compiler] Generics: problem with partial generics
60
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=228291">228291</a>
59
[1.5][compiler] Incorrect unsafe warning for casting complex but static types.
61
[1.5][compiler] Incorrect unsafe warning for casting complex but static types.
60
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=79798">79798</a>
62
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=79798">79798</a>
61
[compiler] Wrong compiler error when interface overrides two methods with same signature but different exceptions
63
[compiler] Wrong compiler error when interface overrides two methods with same signature but different exceptions
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+53 lines)
Lines 41246-41249 Link Here
41246
			},
41246
			},
41247
			"");
41247
			"");
41248
}
41248
}
41249
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231861
41250
public void test1330() {
41251
	this.runConformTest(
41252
			new String[] {
41253
				"p/BaseValue.java", // =================
41254
				"package p;\n" + 
41255
				"interface Value<B> {}\n" + 
41256
				"public class BaseValue<B> implements Value<B> {}\n",
41257
				"p/Model.java", // =================
41258
				"package p;\n" + 
41259
				"public class Model {\n" + 
41260
				"  public java.util.Map<String, Value> map = new java.util.LinkedHashMap<String,Value>();\n" + 
41261
				"}\n", // =================
41262
			},
41263
			"");
41264
	this.runConformTest(
41265
			new String[] {
41266
				"p2/Person.java", // =================
41267
				"package p2;\n" + 
41268
				"public class Person extends p.Model {\n" + 
41269
				"        void test() {\n" + 
41270
				"                this.map.put(\"name\", new p.BaseValue<String>());\n" + 
41271
				"        }\n" + 
41272
				"}\n", // =================
41273
			},
41274
			"",
41275
			null,
41276
			false,
41277
			null);	
41278
}
41279
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=231861 - variation
41280
public void test1331() {
41281
	this.runConformTest(
41282
			new String[] {
41283
				"p/BaseValue.java", // =================
41284
				"package p;\n" + 
41285
				"interface Value<B> {}\n" + 
41286
				"public class BaseValue<B> implements Value<B> {}\n",
41287
				"p/Model.java", // =================
41288
				"package p;\n" + 
41289
				"public class Model {\n" + 
41290
				"  public java.util.Map<String, Value> map = new java.util.LinkedHashMap<String,Value>();\n" + 
41291
				"}\n",
41292
				"p2/Person.java", // =================
41293
				"package p2;\n" + 
41294
				"public class Person extends p.Model {\n" + 
41295
				"        void test() {\n" + 
41296
				"                this.map.put(\"name\", new p.BaseValue<String>());\n" + 
41297
				"        }\n" + 
41298
				"}\n", // =================
41299
			},
41300
			"");
41301
}
41249
}
41302
}

Return to bug 231861