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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/ClassFileTests.java (+17 lines)
Lines 84-89 Link Here
84
		"package generic;\n" +
84
		"package generic;\n" +
85
		"public class V extends X<Thread> implements I<String> {\n" +
85
		"public class V extends X<Thread> implements I<String> {\n" +
86
		"}",
86
		"}",
87
		"generic/GenericField.java",
88
		"package generic;\n" +
89
		"import java.util.List;\n" +
90
		"public class GenericField {\n" +
91
		"	protected List<String> myField;\n" + 
92
		"}",
87
		"annotated/X.java",
93
		"annotated/X.java",
88
		"package annotated;\n" +
94
		"package annotated;\n" +
89
		"@MyOtherAnnot\n" +
95
		"@MyOtherAnnot\n" +
Lines 1394-1397 Link Here
1394
	assertEquals("Wrong value", 0xBA, bytes[2] & 0xFF);
1400
	assertEquals("Wrong value", 0xBA, bytes[2] & 0xFF);
1395
	assertEquals("Wrong value", 0xBE, bytes[3] & 0xFF);
1401
	assertEquals("Wrong value", 0xBE, bytes[3] & 0xFF);
1396
}
1402
}
1403
/*
1404
 * Ensures that the annotations of a binary field are correct
1405
 */
1406
public void testGenericFieldGetgetTypeSignature() throws JavaModelException {
1407
	IType type = this.jarRoot.getPackageFragment("generic").getClassFile("GenericField.class").getType();
1408
	IField field = type.getField("myField");
1409
	assertEquals(
1410
		"Wrong type signature",
1411
		"Ljava.util.List<Ljava.lang.String;>;",
1412
		field.getTypeSignature());
1413
}
1397
}
1414
}
(-)model/org/eclipse/jdt/internal/core/BinaryField.java (+4 lines)
Lines 75-80 Link Here
75
 */
75
 */
76
public String getTypeSignature() throws JavaModelException {
76
public String getTypeSignature() throws JavaModelException {
77
	IBinaryField info = (IBinaryField) getElementInfo();
77
	IBinaryField info = (IBinaryField) getElementInfo();
78
	char[] genericSignature = info.getGenericSignature();
79
	if (genericSignature != null) {
80
		return new String(ClassFile.translatedName(genericSignature));
81
	}
78
	return new String(ClassFile.translatedName(info.getTypeName()));
82
	return new String(ClassFile.translatedName(info.getTypeName()));
79
}
83
}
80
/* (non-Javadoc)
84
/* (non-Javadoc)

Return to bug 272706