### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java,v retrieving revision 1.73 diff -u -r1.73 TypeHierarchyTests.java --- src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 27 Sep 2007 10:30:32 -0000 1.73 +++ src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 27 Sep 2007 10:46:00 -0000 @@ -585,6 +585,16 @@ IType type = getClassFile("TypeHierarchy", "lib.jar", "binary", "I.class").getType(); assertTrue("I must be included", this.typeHierarchy.contains(type)); } +/* + * Ensures that contains(IType) returns false for Object for a super type hierarchy on an interface. + * (regression test for bug 204777 ITypeHierarchy.contains() wrong for interface hierarchies) + */ +public void testContains4() throws JavaModelException { + IType type = getCompilationUnit("/TypeHierarchy15/src/I.java").getType("I"); + ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null); + IType obj = getClassFile("TypeHierarchy15", getExternalJCLPathString("1.5"), "java.lang", "Object.class").getType(); + assertFalse("Hierarchy should not contain java.lang.Object", hierarchy.contains(obj)); +} public void testCycle() throws JavaModelException { IType type = getCompilationUnit("/TypeHierarchy/src/cycle/X.java").getType("X"); ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);