Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java,v retrieving revision 1.157 diff -u -r1.157 ASTConverterTest2.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 16 Jun 2005 08:40:56 -0000 1.157 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java 28 Jun 2005 10:08:46 -0000 @@ -42,7 +42,7 @@ } static { -// TESTS_NAMES = new String[] {"test0575"}; +// TESTS_NAMES = new String[] {"test0576"}; // TESTS_NUMBERS = new int[] { 606 }; } public static Test suite() { @@ -5338,6 +5338,34 @@ } } + /* + * Ensures that the binding key of a raw member type is correct. + * (regression test for bug 100549 Strange binding keys from AST on class file of nested type) + */ + public void test0576() throws CoreException, IOException { + try { + IJavaProject project = createJavaProject("P1", new String[] {""}, new String[] {"CONVERTER_JCL15_LIB"}, "", "1.5"); + addLibrary(project, "lib.jar", "src.zip", new String[] { + "/P1/p/X.java", + "package p;\n" + + "public class X {\n" + + " /*start*/public class Member {\n" + + " }/*end*/\n" + + "}", + }, "1.5"); + IClassFile classFile = getClassFile("P1", "/P1/lib.jar", "p", "X$Member.class"); + String source = classFile.getSource(); + MarkerInfo markerInfo = new MarkerInfo(source); + markerInfo.astStarts = new int[] {source.indexOf("/*start*/") + "/*start*/".length()}; + markerInfo.astEnds = new int[] {source.indexOf("/*end*/")}; + ASTNode node = buildAST(markerInfo, classFile); + ITypeBinding binding = ((TypeDeclaration) node).resolveBinding(); + assertBindingKeyEquals("Lp/X.Member;", binding.getKey()); + } finally { + deleteProject("P1"); + } + } + public void test0606() throws JavaModelException { ICompilationUnit sourceUnit = getCompilationUnit("Converter", "src", "test0606", "X.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ ASTNode result = runConversion(sourceUnit, true);