Index: ASTConverterTestAST3_2.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v retrieving revision 1.56 diff -u -r1.56 ASTConverterTestAST3_2.java --- ASTConverterTestAST3_2.java 3 Jun 2005 00:59:55 -0000 1.56 +++ ASTConverterTestAST3_2.java 14 Jun 2005 18:38:26 -0000 @@ -70,6 +70,7 @@ import org.eclipse.jdt.core.dom.NullLiteral; import org.eclipse.jdt.core.dom.PackageDeclaration; import org.eclipse.jdt.core.dom.ParenthesizedExpression; +import org.eclipse.jdt.core.dom.PrimitiveType; import org.eclipse.jdt.core.dom.QualifiedName; import org.eclipse.jdt.core.dom.ReturnStatement; import org.eclipse.jdt.core.dom.SimpleName; @@ -105,7 +106,7 @@ static { // TESTS_NAMES = new String[] {"test0602"}; -// TESTS_NUMBERS = new int[] { 611 }; +// TESTS_NUMBERS = new int[] { 613 }; } public static Test suite() { return buildTestSuite(ASTConverterTestAST3_2.class); @@ -6493,4 +6494,44 @@ workingCopy.discardWorkingCopy(); } } + + /* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=99982 + */ + public void test0612() throws JavaModelException { + ICompilationUnit workingCopy = null; + try { + String contents = + "public class X {\n" + + " void foo(boolean[]value) {\n" + + " }\n" + + "}"; + workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); + ASTNode node = buildAST( + contents, + workingCopy); + assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); + CompilationUnit unit = (CompilationUnit) node; + assertProblemsSize(unit, 0); + node = getASTNode(unit, 0, 0); + assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); + MethodDeclaration methodDeclaration = (MethodDeclaration) node; + List parameters = methodDeclaration.parameters(); + assertEquals("Wrong size", 1, parameters.size()); + SingleVariableDeclaration variableDeclaration = (SingleVariableDeclaration) parameters.get(0); + checkSourceRange(variableDeclaration, "boolean[]value", contents); + Type type = variableDeclaration.getType(); + checkSourceRange(type, "boolean[]", contents); + assertTrue("Not an array type", type.isArrayType()); + ArrayType arrayType = (ArrayType) type; + Type componentType = arrayType.getComponentType(); + assertTrue("Not a primitive type", componentType.isPrimitiveType()); + PrimitiveType primitiveType = (PrimitiveType) componentType; + assertEquals("Not boolean", PrimitiveType.BOOLEAN, primitiveType.getPrimitiveTypeCode()); + checkSourceRange(primitiveType, "boolean", contents); + } finally { + if (workingCopy != null) + workingCopy.discardWorkingCopy(); + } + } }