### Eclipse Workspace Patch 1.0
#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.157
diff -u -r1.157 CompletionParser.java
--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 21 Apr 2006 12:48:26 -0000 1.157
+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 30 Jun 2006 08:53:20 -0000
@@ -207,6 +207,16 @@
new CompletionOnFieldType((TypeReference)orphan, true), 0);
return;
}
+
+ if(orphan instanceof Annotation) {
+ TypeDeclaration fakeType =
+ new CompletionOnAnnotationOfType(
+ FAKE_TYPE_NAME,
+ this.compilationUnit.compilationResult(),
+ (Annotation)orphan);
+ currentElement.parent.add(fakeType, 0);
+ return;
+ }
}
}
Index: buildnotes_jdt-core.html
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v
retrieving revision 1.5338
diff -u -r1.5338 buildnotes_jdt-core.html
--- buildnotes_jdt-core.html 29 Jun 2006 16:36:48 -0000 1.5338
+++ buildnotes_jdt-core.html 30 Jun 2006 08:53:19 -0000
@@ -52,7 +52,9 @@
What's new in this drop
Problem Reports Fixed
-117302
+148742
+[5.0][content assist] Annotation content assist not working in all cases for parameters
+
117302
Clean build of large project gives unresolved type errors
147875
[1.5][compiler] NPE when initializing annotations of a binary field
#P org.eclipse.jdt.core.tests.compiler
Index: src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java,v
retrieving revision 1.12
diff -u -r1.12 AnnotationCompletionParserTest.java
--- src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java 29 Mar 2006 03:50:23 -0000 1.12
+++ src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java 30 Jun 2006 08:53:24 -0000
@@ -712,6 +712,7 @@
String expectedReplacedSource = "MyAnn";
String expectedUnitDisplayString =
"public class X {\n" +
+ " @\n" +
" public X() {\n" +
" }\n" +
" void foo() {\n" +
@@ -727,29 +728,6 @@
completionIdentifier,
expectedReplacedSource,
"diet ast");
-
- expectedCompletionNodeToString = "@";
- expectedParentNodeToString = "";
- completionIdentifier = "MyAnn";
- expectedReplacedSource = "MyAnn";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " @\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
}
public void test0024(){
String str =
@@ -4645,4 +4623,67 @@
expectedReplacedSource,
"diet ast");
}
+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=148742
+public void test0125(){
+ String str =
+ "public interface X {\n" +
+ " public void test(@TestAnnotation int testParam);\n" +
+ "}";
+
+
+ String completeBehind = "@TestAnnotation";
+ int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
+ String expectedCompletionNodeToString = "@";
+ String expectedParentNodeToString = "";
+ String completionIdentifier = "TestAnnotation";
+ String expectedReplacedSource = "TestAnnotation";
+ String expectedUnitDisplayString =
+ "public interface X {\n" +
+ " @\n" +
+ " public void test() {\n" +
+ " }\n" +
+ "}\n";
+
+ checkDietParse(
+ str.toCharArray(),
+ cursorLocation,
+ expectedCompletionNodeToString,
+ expectedParentNodeToString,
+ expectedUnitDisplayString,
+ completionIdentifier,
+ expectedReplacedSource,
+ "diet ast");
+}
+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148742
+public void test0126(){
+ String str =
+ "public abstract class X {\n" +
+ " public abstract void test(@TestAnnotation int testParam);\n" +
+ "}";
+
+
+ String completeBehind = "@TestAnnotation";
+ int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
+ String expectedCompletionNodeToString = "@";
+ String expectedParentNodeToString = "";
+ String completionIdentifier = "TestAnnotation";
+ String expectedReplacedSource = "TestAnnotation";
+ String expectedUnitDisplayString =
+ "public abstract class X {\n" +
+ " @\n" +
+ " public X() {\n" +
+ " }\n" +
+ " public abstract void test();\n" +
+ "}\n";
+
+ checkDietParse(
+ str.toCharArray(),
+ cursorLocation,
+ expectedCompletionNodeToString,
+ expectedParentNodeToString,
+ expectedUnitDisplayString,
+ completionIdentifier,
+ expectedReplacedSource,
+ "diet ast");
+}
}