### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java,v retrieving revision 1.62 diff -u -r1.62 ResolveTests_1_5.java --- src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java 16 Jul 2008 09:08:18 -0000 1.62 +++ src/org/eclipse/jdt/core/tests/model/ResolveTests_1_5.java 22 Jul 2008 12:27:41 -0000 @@ -2704,4 +2704,75 @@ elements ); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=230830 +public void test0117() throws Exception { + this.workingCopies = new ICompilationUnit[2]; + this.workingCopies[0] = getWorkingCopy( + "/Resolve/src/test/Test.java", + "package test;\n" + + "\n" + + "public class Test {\n" + + " public void foo() {\n" + + " @A(n=) String str;\n" + + " }\n" + + "}"); + + this.workingCopies[1] = getWorkingCopy( + "/Resolve/src/test/A.java", + "package test;\n" + + "\n" + + "public @interface A {\n" + + " public String n();\n" + + "}"); + + + String str = this.workingCopies[0].getSource(); + int start = str.lastIndexOf("str"); + int length = "str".length(); + IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length, this.wcOwner); + + assertElementsEqual( + "Unexpected elements", + "str [in foo() [in Test [in [Working copy] Test.java [in test [in src [in Resolve]]]]]]", + elements + ); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=230830 +public void test0118() throws Exception { + this.workingCopies = new ICompilationUnit[2]; + this.workingCopies[0] = getWorkingCopy( + "/Resolve/src/test/Test.java", + "package test;\n" + + "\n" + + "public class Test {\n" + + " public void foo() {\n" + + " @A(n=) String str;\n" + + " }\n" + + "}"); + + this.workingCopies[1] = getWorkingCopy( + "/Resolve/src/test/A.java", + "package test;\n" + + "\n" + + "public @interface A {\n" + + " public String n();\n" + + "}"); + + + String str = this.workingCopies[0].getSource(); + int start = str.lastIndexOf("str"); + int length = "str".length(); + IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length, this.wcOwner); + + if (elements != null && + elements.length > 0 && + elements[0] instanceof IAnnotatable) { + IAnnotation[] annotations = ((IAnnotatable)elements[0]).getAnnotations(); + assertAnnotationsEqual( + "@A(n=)\n", + annotations); + } else { + assertTrue("Unexpected elements", false); + } +} } #P org.eclipse.jdt.core Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java,v retrieving revision 1.196 diff -u -r1.196 CompletionParser.java --- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 17 Jul 2008 09:57:30 -0000 1.196 +++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 22 Jul 2008 12:27:46 -0000 @@ -168,6 +168,7 @@ super(problemReporter); this.reportSyntaxErrorIsRequired = false; this.javadocParser.checkDocComment = true; + this.annotationRecoveryActivated = false; if (storeExtraSourceEnds) { this.storeSourceEnds = true; this.sourceEnds = new HashtableOfObjectToInt(); Index: codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java,v retrieving revision 1.85 diff -u -r1.85 AssistParser.java --- codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java 27 Jun 2008 16:04:06 -0000 1.85 +++ codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java 22 Jul 2008 12:27:47 -0000 @@ -80,7 +80,6 @@ setMethodsFullRecovery(false); setStatementsRecovery(false); - this.annotationRecoveryActivated = false; } public abstract char[] assistIdentifier(); public int bodyEnd(AbstractMethodDeclaration method){