View | Details | Raw Unified | Return to bug 148742
Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (+10 lines)
Lines 207-212 Link Here
207
						new CompletionOnFieldType((TypeReference)orphan, true), 0);
207
						new CompletionOnFieldType((TypeReference)orphan, true), 0);
208
					return;
208
					return;
209
				}
209
				}
210
				
211
				if(orphan instanceof Annotation) {
212
					TypeDeclaration fakeType =
213
						new CompletionOnAnnotationOfType(
214
								FAKE_TYPE_NAME, 
215
								this.compilationUnit.compilationResult(),
216
								(Annotation)orphan);
217
					currentElement.parent.add(fakeType, 0);
218
					return;
219
				}
210
			}
220
			}
211
		}
221
		}
212
222
(-)buildnotes_jdt-core.html (-1 / +3 lines)
Lines 52-58 Link Here
52
<h2>What's new in this drop</h2>
52
<h2>What's new in this drop</h2>
53
53
54
<h3>Problem Reports Fixed</h3>
54
<h3>Problem Reports Fixed</h3>
55
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=117302">117302</a>
55
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=148742">148742</a>
56
[5.0][content assist] Annotation content assist not working in all cases for parameters
57
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=117302">117302</a>
56
Clean build of large project gives unresolved type errors
58
Clean build of large project gives unresolved type errors
57
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=147875">147875</a>
59
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=147875">147875</a>
58
[1.5][compiler] NPE when initializing annotations of a binary field
60
[1.5][compiler] NPE when initializing annotations of a binary field
(-)src/org/eclipse/jdt/core/tests/compiler/parser/AnnotationCompletionParserTest.java (-23 / +64 lines)
Lines 712-717 Link Here
712
	String expectedReplacedSource = "MyAnn";
712
	String expectedReplacedSource = "MyAnn";
713
	String expectedUnitDisplayString =
713
	String expectedUnitDisplayString =
714
		"public class X {\n" + 
714
		"public class X {\n" + 
715
		"  @<CompleteOnType:MyAnn>\n" + 
715
		"  public X() {\n" + 
716
		"  public X() {\n" + 
716
		"  }\n" + 
717
		"  }\n" + 
717
		"  void foo() {\n" + 
718
		"  void foo() {\n" + 
Lines 727-755 Link Here
727
			completionIdentifier,
728
			completionIdentifier,
728
			expectedReplacedSource,
729
			expectedReplacedSource,
729
	"diet ast");
730
	"diet ast");
730
	
731
	expectedCompletionNodeToString = "@<CompleteOnType:MyAnn>";
732
	expectedParentNodeToString = "<NONE>";
733
	completionIdentifier = "MyAnn";
734
	expectedReplacedSource = "MyAnn";
735
	expectedUnitDisplayString =
736
		"public class X {\n" + 
737
		"  public X() {\n" + 
738
		"  }\n" + 
739
		"  void foo() {\n" + 
740
		"    @<CompleteOnType:MyAnn>\n" + 
741
		"  }\n" + 
742
		"}\n";
743
744
	checkMethodParse(
745
			str.toCharArray(),
746
			cursorLocation,
747
			expectedCompletionNodeToString,
748
			expectedParentNodeToString,
749
			expectedUnitDisplayString,
750
			completionIdentifier,
751
			expectedReplacedSource,
752
			"full ast");
753
}
731
}
754
public void test0024(){
732
public void test0024(){
755
	String str =
733
	String str =
Lines 4645-4648 Link Here
4645
			expectedReplacedSource,
4623
			expectedReplacedSource,
4646
	"diet ast");
4624
	"diet ast");
4647
}
4625
}
4626
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=148742
4627
public void test0125(){
4628
	String str =
4629
		"public interface X {\n" +
4630
		"  public void test(@TestAnnotation int testParam);\n" +
4631
		"}";
4632
4633
4634
	String completeBehind = "@TestAnnotation";
4635
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4636
	String expectedCompletionNodeToString = "@<CompleteOnType:TestAnnotation>";
4637
	String expectedParentNodeToString = "<NONE>";
4638
	String completionIdentifier = "TestAnnotation";
4639
	String expectedReplacedSource = "TestAnnotation";
4640
	String expectedUnitDisplayString =
4641
		"public interface X {\n" + 
4642
		"  @<CompleteOnType:TestAnnotation>\n" + 
4643
		"  public void test() {\n" + 
4644
		"  }\n" + 
4645
		"}\n";
4646
4647
	checkDietParse(
4648
			str.toCharArray(),
4649
			cursorLocation,
4650
			expectedCompletionNodeToString,
4651
			expectedParentNodeToString,
4652
			expectedUnitDisplayString,
4653
			completionIdentifier,
4654
			expectedReplacedSource,
4655
	"diet ast");
4656
}
4657
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148742
4658
public void test0126(){
4659
	String str =
4660
		"public abstract class X {\n" +
4661
		"  public abstract void test(@TestAnnotation int testParam);\n" +
4662
		"}";
4663
4664
4665
	String completeBehind = "@TestAnnotation";
4666
	int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
4667
	String expectedCompletionNodeToString = "@<CompleteOnType:TestAnnotation>";
4668
	String expectedParentNodeToString = "<NONE>";
4669
	String completionIdentifier = "TestAnnotation";
4670
	String expectedReplacedSource = "TestAnnotation";
4671
	String expectedUnitDisplayString =
4672
		"public abstract class X {\n" + 
4673
		"  @<CompleteOnType:TestAnnotation>\n" + 
4674
		"  public X() {\n" + 
4675
		"  }\n" + 
4676
		"  public abstract void test();\n" + 
4677
		"}\n";
4678
4679
	checkDietParse(
4680
			str.toCharArray(),
4681
			cursorLocation,
4682
			expectedCompletionNodeToString,
4683
			expectedParentNodeToString,
4684
			expectedUnitDisplayString,
4685
			completionIdentifier,
4686
			expectedReplacedSource,
4687
	"diet ast");
4688
}
4648
}
4689
}

Return to bug 148742