Bug 339789

Summary: Content assist will not offer choice from a generic type that is listed in the favorites
Product: [Eclipse Project] JDT Reporter: David Corbin <dcorbin>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann, srikanth_sankaran
Version: 3.7   
Target Milestone: 3.7 M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
test case none

Description David Corbin CLA 2011-03-12 09:09:54 EST
Build Identifier: M20110210-1200

I have a class that has static methods on it.  The class has a type parameter.  The class is listed in the Java/Editor/Content Assist/Favorites preferences pane.

When I type the start of one of these static method names, Eclipse does NOT offer the method in Content Assist.

I've debugged through the code, and I think I've found where this case is being tossed aside. 
org.eclipse.jdt.internal.codeassist.CompletionEngine#findFieldsAndMethodsFromFavorites has a switch statement with a case of Binding.TYPE, however adding the type in question is Binding.GENERIC_TYPE.

I did a quick spike by adding Binding.GENERIC_TYPE right along side of Binding.TYPE, and it appears to have worked, but I have no idea what other consequences might be.

Reproducible: Always

Steps to Reproduce:
1. Create a generic class
2. define a static method on it
3. Add it to the Content Assist Favorites
4. In the method of another class, type the class method name and invoke Content Assist.
Comment 1 Olivier Thomann CLA 2011-03-13 10:11:57 EDT
Could you please try with 3.7M6 ?
It seems to work for me.
Comment 2 David Corbin CLA 2011-03-13 13:19:41 EDT
You're right.  It appears to have been address in 3.7
Comment 3 Ayushman Jain CLA 2011-03-14 02:03:22 EDT
Created attachment 191081 [details]
test case

I could not reproduce using the above test case after adding p.Test.doSomething in the content assist favourites.
Comment 4 Ayushman Jain CLA 2011-03-14 02:03:50 EDT
Closing as WORKSFORME
Comment 5 Srikanth Sankaran CLA 2011-04-25 02:42:15 EDT
Verified for 3.7 M7