Index: src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java,v retrieving revision 1.44 diff -u -r1.44 TypeHierarchyTests.java --- src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 9 May 2005 09:17:48 -0000 1.44 +++ src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java 15 Jun 2005 10:56:59 -0000 @@ -34,7 +34,7 @@ this.displayName = true; } static { -// TESTS_NAMES= new String[] { "testBinaryTypeHiddenByOtherJar" }; +// TESTS_NAMES= new String[] { "testGeneric7" }; } public static Test suite() { return buildTestSuite(TypeHierarchyTests.class); @@ -107,6 +107,17 @@ "public class A implements I {\n" + "}" ); + createFile( + "/TypeHierarchy15/src/X99606.java", + "public class X99606 extends Y99606 {\n" + + " static class Color {}\n" + + "}" + ); + createFile( + "/TypeHierarchy15/src/Y99606.java", + "public class Y99606 {\n" + + "}" + ); } /* (non-Javadoc) @@ -961,6 +972,22 @@ IType[] subtypes = hierarchy.getSubtypes(type); assertEquals("Unexpected key", "Lutil/Map;", subtypes.length < 2 ? null : subtypes[1].getKey()); } +/* + * Ensures that a hierarchy on a generic type that is extended using a member as a type parameter can be opened + * (regression test for bug 99606 Subtype not found if parameterized on inner class) + */ +public void testGeneric7() throws JavaModelException { + IType type = getCompilationUnit("/TypeHierarchy15/src/Y99606.java").getType("Y99606"); + ITypeHierarchy hierarchy = type.newTypeHierarchy(null); + assertHierarchyEquals( + "Focus: Y99606 [in Y99606.java [in [in src [in TypeHierarchy15]]]]\n" + + "Super types:\n" + + " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString("1.5") + " [in TypeHierarchy15]]]]\n" + + "Sub types:\n" + + " X99606 [in X99606.java [in [in src [in TypeHierarchy15]]]]\n", + hierarchy + ); +} /** * Ensures the correctness of all classes in a type hierarchy based on a region. */