|
Lines 48-51
Link Here
|
| 48 |
import org.eclipse.jdt.core.dom.NullLiteral; |
48 |
import org.eclipse.jdt.core.dom.NullLiteral; |
| 49 |
import org.eclipse.jdt.core.dom.NumberLiteral; |
49 |
import org.eclipse.jdt.core.dom.NumberLiteral; |
|
|
50 |
import org.eclipse.jdt.core.dom.QualifiedName; |
| 51 |
import org.eclipse.jdt.core.dom.SimpleName; |
| 50 |
import org.eclipse.jdt.core.dom.SingleVariableDeclaration; |
52 |
import org.eclipse.jdt.core.dom.SingleVariableDeclaration; |
| 51 |
import org.eclipse.jdt.core.dom.SwitchStatement; |
53 |
import org.eclipse.jdt.core.dom.SwitchStatement; |
|
Lines 964-966
Link Here
|
| 964 |
assertEquals("Method should be malformed", ASTNode.MALFORMED, (method.getFlags() & ASTNode.MALFORMED)); |
966 |
assertEquals("Method should be malformed", ASTNode.MALFORMED, (method.getFlags() & ASTNode.MALFORMED)); |
| 965 |
} |
967 |
} |
|
|
968 |
/** |
| 969 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=405934 |
| 970 |
* |
| 971 |
* @deprecated as it uses deprecated methods |
| 972 |
*/ |
| 973 |
public void test0022() throws JavaModelException { |
| 974 |
String contents = |
| 975 |
"public class X {\n" + |
| 976 |
" void foo() throws @NonNull EOFException, java.io.@NonNull FileNotFoundException {}\n" + |
| 977 |
"}\n"; |
| 978 |
this.workingCopy = getWorkingCopy("/Converter17/src/X.java", false); |
| 979 |
ASTNode node = buildAST(contents, this.workingCopy, false); |
| 980 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
| 981 |
CompilationUnit unit = (CompilationUnit) node; |
| 982 |
TypeDeclaration type = (TypeDeclaration) unit.types().get(0); |
| 983 |
node = (ASTNode) type.bodyDeclarations().get(0); |
| 984 |
assertEquals("Not a method Declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); |
| 985 |
MethodDeclaration method = (MethodDeclaration) node; |
| 986 |
SimpleName exception1 = (SimpleName) method.thrownExceptions().get(0); |
| 987 |
assertEquals("QualifiedName should be malformed", ASTNode.MALFORMED, (exception1.getFlags() & ASTNode.MALFORMED)); |
| 988 |
QualifiedName exception2 = (QualifiedName) method.thrownExceptions().get(1); |
| 989 |
assertEquals("QualifiedName should be malformed", ASTNode.MALFORMED, (exception2.getFlags() & ASTNode.MALFORMED)); |
| 990 |
} |
| 966 |
} |
991 |
} |