Index: src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java,v retrieving revision 1.32 diff -u -r1.32 ASTModelBridgeTests.java --- src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 6 Jun 2005 13:09:32 -0000 1.32 +++ src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 15 Jun 2005 11:33:01 -0000 @@ -161,7 +161,7 @@ /* * Ensures that the IJavaElement of an IBinding representing an array type is correct. */ - public void testArrayType() throws JavaModelException { + public void testArrayType1() throws JavaModelException { ASTNode node = buildAST( "public class X {\n" + " /*start*/Object[]/*end*/ field;\n" + @@ -179,6 +179,27 @@ } /* + * Ensures that the IJavaElement of an IBinding representing an array type of base type null. + * (regression test for bug 100142 + CCE when calling ITypeBinding#getJavaElement() on char[][] + */ + public void testArrayType2() throws JavaModelException { + ASTNode node = buildAST( + "public class X {\n" + + " /*start*/char[][]/*end*/ field;\n" + + "}" + ); + IBinding binding = ((ArrayType) node).resolveBinding(); + assertNotNull("No binding", binding); + IJavaElement element = binding.getJavaElement(); + assertElementEquals( + "Unexpected Java element", + "", + element + ); + } + + /* * Ensures that the IJavaElement of an IBinding representing a method coming from a class file is correct. * (regression test for bug 91445 IMethodBinding.getJavaElement() returns an "unopen" IMethod) */