Bug 133491

Summary: Missing code assist in annotation
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: philippe_mulet
Version: 3.2   
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 132207    
Attachments:
Description Flags
Proposed fix
none
Better fix none

Description Martin Aeschlimann CLA 2006-03-28 05:33:04 EST
20060328
from bug 132207:

-----
package pack;
public @interface MyAnnotation {
        NeedsImportEnum value();
        boolean value2() default false;
}
------
package pack;
public enum NeedsImportEnum {
        HELLO;
}

-----
package other;
public class A {
        @MyAnnotation(N |code assist
        public void hello() {
        }
}

Code assist should suggest NeedsImportEnum.

Quick fix uses the code assist infrastructure to evaluate the types required.
It works if MyAnnotation only has one attribute (value).
Comment 1 David Audel CLA 2006-04-19 07:23:36 EDT
Created attachment 38919 [details]
Proposed fix
Comment 2 David Audel CLA 2006-04-19 07:27:41 EDT
Philippe - Do you want this fix for 3.2RC2 ?

With this fix, the behavior with the test case of the bug is the same as if MyAnnotation would have only one member value pair named 'value'.
Comment 3 Philipe Mulet CLA 2006-04-19 09:19:55 EDT
+1 for 3.2RC2
Comment 4 David Audel CLA 2006-04-19 09:49:37 EDT
Fix released and test added
  CompletionTests_1_5#test0285()
Comment 5 David Audel CLA 2006-04-24 11:14:08 EDT
Created attachment 39285 [details]
Better fix

Performances with the previous fix are very bad.

This new fix correct the original problem and the performance problem.
Comment 6 David Audel CLA 2006-04-24 11:17:25 EDT
Better fix released.
Comment 7 Olivier Thomann CLA 2006-04-28 13:15:25 EDT
Verified with I20060427-1600 for 3.2RC2.
Get the right proposal, only if the import for MyAnnotation is there in the A class.