Lines 1988-1994
Link Here
|
1988 |
assertTrue("not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
1988 |
assertTrue("not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
1989 |
MethodDeclaration methodDeclaration = (MethodDeclaration) node; |
1989 |
MethodDeclaration methodDeclaration = (MethodDeclaration) node; |
1990 |
assertTrue("Is a constructor", !methodDeclaration.isConstructor()); |
1990 |
assertTrue("Is a constructor", !methodDeclaration.isConstructor()); |
1991 |
checkSourceRange(methodDeclaration, "private void foo(){", source); |
1991 |
checkSourceRange(methodDeclaration, "private void foo(){", source, true/*expectMalformed*/); |
1992 |
node = getASTNode(compilationUnit, 0, 1); |
1992 |
node = getASTNode(compilationUnit, 0, 1); |
1993 |
assertNotNull("No node", node); |
1993 |
assertNotNull("No node", node); |
1994 |
assertTrue("not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
1994 |
assertTrue("not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
Lines 3203-3209
Link Here
|
3203 |
assertTrue("Not a constructor declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
3203 |
assertTrue("Not a constructor declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
3204 |
MethodDeclaration declaration = (MethodDeclaration) node; |
3204 |
MethodDeclaration declaration = (MethodDeclaration) node; |
3205 |
assertTrue("A constructor", !declaration.isConstructor()); |
3205 |
assertTrue("A constructor", !declaration.isConstructor()); |
3206 |
checkSourceRange(declaration, "public method(final int parameter);", source); |
3206 |
checkSourceRange(declaration, "public method(final int parameter);", source, true/*expectMalformed*/); |
3207 |
} |
3207 |
} |
3208 |
|
3208 |
|
3209 |
/** |
3209 |
/** |
Lines 3221-3227
Link Here
|
3221 |
assertTrue("Not a constructor declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
3221 |
assertTrue("Not a constructor declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
3222 |
MethodDeclaration declaration = (MethodDeclaration) node; |
3222 |
MethodDeclaration declaration = (MethodDeclaration) node; |
3223 |
assertTrue("A constructor", !declaration.isConstructor()); |
3223 |
assertTrue("A constructor", !declaration.isConstructor()); |
3224 |
checkSourceRange(declaration, "public method(final int parameter) { }", source); |
3224 |
checkSourceRange(declaration, "public method(final int parameter) { }", source, true/*expectMalformed*/); |
3225 |
} |
3225 |
} |
3226 |
|
3226 |
|
3227 |
/** |
3227 |
/** |
Lines 3358-3364
Link Here
|
3358 |
assertTrue("Not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
3358 |
assertTrue("Not a method declaration", node.getNodeType() == ASTNode.METHOD_DECLARATION); //$NON-NLS-1$ |
3359 |
MethodDeclaration declaration = (MethodDeclaration) node; |
3359 |
MethodDeclaration declaration = (MethodDeclaration) node; |
3360 |
assertTrue("Not a constructor", declaration.isConstructor()); |
3360 |
assertTrue("Not a constructor", declaration.isConstructor()); |
3361 |
checkSourceRange(declaration, "public A();", source); |
3361 |
checkSourceRange(declaration, "public A();", source, true/*expectMalformed*/); |
3362 |
} |
3362 |
} |
3363 |
|
3363 |
|
3364 |
/** |
3364 |
/** |
Lines 5493-5499
Link Here
|
5493 |
node = getASTNode(compilationUnit, 0, 0); |
5493 |
node = getASTNode(compilationUnit, 0, 0); |
5494 |
assertEquals("wrong type", ASTNode.FIELD_DECLARATION, node.getNodeType()); |
5494 |
assertEquals("wrong type", ASTNode.FIELD_DECLARATION, node.getNodeType()); |
5495 |
FieldDeclaration fieldDeclaration = (FieldDeclaration) node; |
5495 |
FieldDeclaration fieldDeclaration = (FieldDeclaration) node; |
5496 |
checkSourceRange(fieldDeclaration, "d String[][]", source.toCharArray()); |
5496 |
checkSourceRange(fieldDeclaration, "d String[][]", source.toCharArray(), true/*expectMalformed*/); |
5497 |
Type type = fieldDeclaration.getType(); |
5497 |
Type type = fieldDeclaration.getType(); |
5498 |
assertTrue("Not a simple type", type.isSimpleType()); |
5498 |
assertTrue("Not a simple type", type.isSimpleType()); |
5499 |
List fragments = fieldDeclaration.fragments(); |
5499 |
List fragments = fieldDeclaration.fragments(); |
Lines 7243-7249
Link Here
|
7243 |
List fragments = fieldDeclaration.fragments(); |
7243 |
List fragments = fieldDeclaration.fragments(); |
7244 |
assertEquals("wrong size", 1, fragments.size()); |
7244 |
assertEquals("wrong size", 1, fragments.size()); |
7245 |
VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0); |
7245 |
VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0); |
7246 |
checkSourceRange(fragment, "s = {\"\",,,", source); |
7246 |
checkSourceRange(fragment, "s = {\"\",,,", source, true/*expectMalformed*/); |
7247 |
assertTrue("Not initializer", fragment.getInitializer() == null); |
7247 |
assertTrue("Not initializer", fragment.getInitializer() == null); |
7248 |
assertTrue("Not a malformed node", isMalformed(fragment)); |
7248 |
assertTrue("Not a malformed node", isMalformed(fragment)); |
7249 |
} |
7249 |
} |