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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java (+10 lines)
Lines 585-590 Link Here
585
	IType type = getClassFile("TypeHierarchy", "lib.jar", "binary", "I.class").getType();
585
	IType type = getClassFile("TypeHierarchy", "lib.jar", "binary", "I.class").getType();
586
	assertTrue("I must be included", this.typeHierarchy.contains(type));
586
	assertTrue("I must be included", this.typeHierarchy.contains(type));
587
}
587
}
588
/*
589
 * Ensures that contains(IType) returns false for Object for a super type hierarchy on an interface.
590
 * (regression test for bug 204777 ITypeHierarchy.contains(<Object>) wrong for interface hierarchies)
591
 */
592
public void testContains4() throws JavaModelException {
593
	IType type = getCompilationUnit("/TypeHierarchy15/src/I.java").getType("I");
594
	ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);
595
	IType obj = getClassFile("TypeHierarchy15", getExternalJCLPathString("1.5"), "java.lang", "Object.class").getType();
596
	assertFalse("Hierarchy should not contain java.lang.Object", hierarchy.contains(obj));
597
}
588
public void testCycle() throws JavaModelException {
598
public void testCycle() throws JavaModelException {
589
	IType type = getCompilationUnit("/TypeHierarchy/src/cycle/X.java").getType("X");
599
	IType type = getCompilationUnit("/TypeHierarchy/src/cycle/X.java").getType("X");
590
	ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);
600
	ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);

Return to bug 204777