Lines 70-75
Link Here
|
70 |
import org.eclipse.jdt.core.dom.NullLiteral; |
70 |
import org.eclipse.jdt.core.dom.NullLiteral; |
71 |
import org.eclipse.jdt.core.dom.PackageDeclaration; |
71 |
import org.eclipse.jdt.core.dom.PackageDeclaration; |
72 |
import org.eclipse.jdt.core.dom.ParenthesizedExpression; |
72 |
import org.eclipse.jdt.core.dom.ParenthesizedExpression; |
|
|
73 |
import org.eclipse.jdt.core.dom.PrimitiveType; |
73 |
import org.eclipse.jdt.core.dom.QualifiedName; |
74 |
import org.eclipse.jdt.core.dom.QualifiedName; |
74 |
import org.eclipse.jdt.core.dom.ReturnStatement; |
75 |
import org.eclipse.jdt.core.dom.ReturnStatement; |
75 |
import org.eclipse.jdt.core.dom.SimpleName; |
76 |
import org.eclipse.jdt.core.dom.SimpleName; |
Lines 105-111
Link Here
|
105 |
|
106 |
|
106 |
static { |
107 |
static { |
107 |
// TESTS_NAMES = new String[] {"test0602"}; |
108 |
// TESTS_NAMES = new String[] {"test0602"}; |
108 |
// TESTS_NUMBERS = new int[] { 611 }; |
109 |
// TESTS_NUMBERS = new int[] { 613 }; |
109 |
} |
110 |
} |
110 |
public static Test suite() { |
111 |
public static Test suite() { |
111 |
return buildTestSuite(ASTConverterTestAST3_2.class); |
112 |
return buildTestSuite(ASTConverterTestAST3_2.class); |
Lines 6493-6496
Link Here
|
6493 |
workingCopy.discardWorkingCopy(); |
6494 |
workingCopy.discardWorkingCopy(); |
6494 |
} |
6495 |
} |
6495 |
} |
6496 |
} |
|
|
6497 |
|
6498 |
/* |
6499 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=99982 |
6500 |
*/ |
6501 |
public void test0612() throws JavaModelException { |
6502 |
ICompilationUnit workingCopy = null; |
6503 |
try { |
6504 |
String contents = |
6505 |
"public class X {\n" + |
6506 |
" void foo(boolean[]value) {\n" + |
6507 |
" }\n" + |
6508 |
"}"; |
6509 |
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); |
6510 |
ASTNode node = buildAST( |
6511 |
contents, |
6512 |
workingCopy); |
6513 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
6514 |
CompilationUnit unit = (CompilationUnit) node; |
6515 |
assertProblemsSize(unit, 0); |
6516 |
node = getASTNode(unit, 0, 0); |
6517 |
assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); |
6518 |
MethodDeclaration methodDeclaration = (MethodDeclaration) node; |
6519 |
List parameters = methodDeclaration.parameters(); |
6520 |
assertEquals("Wrong size", 1, parameters.size()); |
6521 |
SingleVariableDeclaration variableDeclaration = (SingleVariableDeclaration) parameters.get(0); |
6522 |
checkSourceRange(variableDeclaration, "boolean[]value", contents); |
6523 |
Type type = variableDeclaration.getType(); |
6524 |
checkSourceRange(type, "boolean[]", contents); |
6525 |
assertTrue("Not an array type", type.isArrayType()); |
6526 |
ArrayType arrayType = (ArrayType) type; |
6527 |
Type componentType = arrayType.getComponentType(); |
6528 |
assertTrue("Not a primitive type", componentType.isPrimitiveType()); |
6529 |
PrimitiveType primitiveType = (PrimitiveType) componentType; |
6530 |
assertEquals("Not boolean", PrimitiveType.BOOLEAN, primitiveType.getPrimitiveTypeCode()); |
6531 |
checkSourceRange(primitiveType, "boolean", contents); |
6532 |
} finally { |
6533 |
if (workingCopy != null) |
6534 |
workingCopy.discardWorkingCopy(); |
6535 |
} |
6536 |
} |
6496 |
} |
6537 |
} |