### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v retrieving revision 1.184 diff -u -r1.184 ASTConverter15Test.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 30 Jan 2006 19:02:09 -0000 1.184 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 31 Jan 2006 21:52:17 -0000 @@ -6280,4 +6280,36 @@ assertNotNull("Should not be null", annotations); assertEquals("Should be empty", 0, annotations.length); } + + /* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=125807 + */ + public void test0208() throws JavaModelException { + this.workingCopy = getWorkingCopy("/Converter15/src/X.java", true/*resolve*/); + String contents = + "@Override(x= 1)\r\n" + + "public class X { }"; + ASTNode node = buildAST( + contents, + this.workingCopy, + false); + assertNotNull("No node", node); + assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); + CompilationUnit compilationUnit = (CompilationUnit) node; + String problems = + "The annotation @Override is disallowed for this location\n" + + "The attribute x is undefined for the annotation type Override"; + assertProblemsSize(compilationUnit, 2, problems); + node = getASTNode(compilationUnit, 0); + assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); + TypeDeclaration typeDeclaration = (TypeDeclaration) node; + List modifiers = typeDeclaration.modifiers(); + assertEquals("Wrong size", 2, modifiers.size()); + assertTrue("Wrong type", modifiers.get(0) instanceof NormalAnnotation); + NormalAnnotation normalAnnotation = (NormalAnnotation) modifiers.get(0); + IResolvedAnnotation resolvedAnnotation = normalAnnotation.resolveAnnotation(); + IResolvedMemberValuePair[] pairs = resolvedAnnotation.getDeclaredMemberValuePairs(); + assertEquals("Wrong size", 1, pairs.length); + assertNotNull("Should not be null", pairs[0].getValue()); + } } \ No newline at end of file