Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v --- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 14 Jun 2005 16:58:41 -0000 1.165 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 20 Jun 2005 14:01:08 -0000 @@ -39,7 +39,7 @@ } static { -// TESTS_NUMBERS = new int[] { 191 }; + TESTS_NUMBERS = new int[] { 192 }; // TESTS_NAMES = new String[] {"test0189"}; } public static Test suite() { @@ -5747,4 +5747,30 @@ assertNotNull("No binding", typeBinding2); assertTrue("Not cast compatible", typeBinding2.isCastCompatible(typeBinding)); } + + // Wrong ParameterizedTypeBinding yields null type declaration result + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=100584 + public void test0192() throws JavaModelException { + this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); + String contents = + "public class X {\n" + + " public static class InnerClass {\n" + + " static class InnerInnerClass {\n" + + " /*start*/X.WrongInnerClass/*end*/.InnerInnerClass m;\n" + + " }\n" + + " }\n" + + "}"; + IBinding[] bindings = resolveBindings(contents, this.workingCopy); + if (bindings[0] != null) { + // should not get here if patch 100584 applied + try { + bindings[0].toString(); + fail("should get an exception if bug 100584 present"); + // which means that the code would now return a non null, + // erroneous binding, yet able to respond to toString + } catch (Throwable t) {/* absorb quietly */} + } + assertTrue("should yield a null, not a malformed binding", + bindings[0] == null); + } } Index: src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java,v --- src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java 7 Jun 2005 16:44:10 -0000 1.18 +++ src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java 20 Jun 2005 14:01:08 -0000 @@ -38,6 +38,7 @@ import org.eclipse.jdt.core.dom.MethodInvocation; import org.eclipse.jdt.core.dom.PackageDeclaration; import org.eclipse.jdt.core.dom.ParameterizedType; +import org.eclipse.jdt.core.dom.QualifiedName; import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.SimpleType; import org.eclipse.jdt.core.dom.TypeDeclaration; @@ -411,6 +412,8 @@ return ((Assignment) node).getRightHandSide().resolveTypeBinding(); case ASTNode.SIMPLE_TYPE: return ((SimpleType) node).resolveBinding(); + case ASTNode.QUALIFIED_NAME: + return ((QualifiedName) node).resolveBinding(); default: throw new Error("Not yet implemented for this type of node: " + node); }