Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 405934
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java (+25 lines)
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
}
(-)dom/org/eclipse/jdt/core/dom/ASTConverter.java (-1 / +5 lines)
Lines 501-505 Link Here
501
				int i = 0;
501
				int i = 0;
502
				do {
502
				do {
503
					thrownException = convert(thrownExceptions[i++]);
503
					TypeReference typeRef = thrownExceptions[i++];
504
					thrownException = convert(typeRef);
505
					if (typeRef.annotations != null && typeRef.annotations.length > 0) {
506
						thrownException.setFlags(thrownException.getFlags() | ASTNode.MALFORMED);
507
					}
504
					internalThownExceptions(methodDecl).add(thrownException);
508
					internalThownExceptions(methodDecl).add(thrownException);
505
				} while (i < thrownExceptionsLength);
509
				} while (i < thrownExceptionsLength);

Return to bug 405934