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 399600
Collapse All | Expand All

(-)a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java (+22 lines)
Lines 1070-1073 Link Here
1070
		method = methods[2];
1070
		method = methods[2];
1071
		assertExtraDimensionsEqual("Incorrect dimension info", method.getExtraDimensionInfos(), "@Annot1 @Annot2 [] []");
1071
		assertExtraDimensionsEqual("Incorrect dimension info", method.getExtraDimensionInfos(), "@Annot1 @Annot2 [] []");
1072
	}
1072
	}
1073
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=399600
1074
	public void test0010() throws JavaModelException {
1075
		String contents =
1076
				"import java.lang.annotation.ElementType;\n" +
1077
						"public class X {\n" +
1078
						"	@Marker int foo(@Marker(\"Blah\") int z) @Marker [] @Marker [] {\n" +
1079
						"		return null;\n" +
1080
						"	}\n" +
1081
						"}\n" +
1082
						"@java.lang.annotation.Target (ElementType.TYPE_USE)\n" +
1083
						"@interface Marker {\n" +
1084
						"	String value() default \"Blah\";\n" +
1085
						"}";
1086
		this.workingCopy = getWorkingCopy("/Converter18/src/X.java", true);
1087
		ASTNode node = buildAST(contents, this.workingCopy);
1088
		assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType());
1089
		CompilationUnit unit = (CompilationUnit) node;
1090
		node = getASTNode(unit, 0, 0);
1091
		assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType());
1092
		MethodDeclaration method = (MethodDeclaration) node;
1093
		assertExtraDimensionsEqual("Incorrect dimension info", method.getExtraDimensionInfos(), "@Marker [] @Marker []");
1094
	}
1073
}
1095
}
(-)a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java (-1 / +9 lines)
Lines 4398-4407 Link Here
4398
		this.scanner.resetTo(start, end);
4398
		this.scanner.resetTo(start, end);
4399
		try {
4399
		try {
4400
			int token;
4400
			int token;
4401
			int count = 0;
4401
			while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
4402
			while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
4402
				switch(token) {
4403
				switch(token) {
4403
					case TerminalTokens.TokenNameRPAREN:
4404
					case TerminalTokens.TokenNameRPAREN:
4404
						return this.scanner.currentPosition;
4405
						count--;
4406
						if (count <= 0) return this.scanner.currentPosition;
4407
						 break;
4408
					case TerminalTokens.TokenNameLPAREN:
4409
						count++;
4410
						//$FALL-THROUGH$
4411
					default:
4412
						break;
4405
				}
4413
				}
4406
			}
4414
			}
4407
		} catch(InvalidInputException e) {
4415
		} catch(InvalidInputException e) {

Return to bug 399600