Bug 393822 - [content assist] filters constructors based on variable type
Summary: [content assist] filters constructors based on variable type
Status: CLOSED DUPLICATE of bug 261315
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.2.1   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-07 17:09 EST by Nathan Reynolds CLA
Modified: 2012-11-07 17:20 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Reynolds CLA 2012-11-07 17:09:02 EST
Let's say I have the following code:

List<Object> list;

list = new |

The | represents where the caret is.  If I hit Ctrl+Space to bring up Content Assist, then it displays some short list of classes (e.g. ArrayList).  Some of the classes are irrelevant because they are the wrong type and the code wouldn't compile if used here.  Some classes are not even displayed that could be used here (e.g. LinkedList, ConcurrentLinkedList).

Let's change the scenario a bit.  Let's say I have the following code:

List<Object> list;

list = new A|

The | represents where the caret is.  If I hit Ctrl+Space to bring up Content Assist, then it displays ArrayList but also a bunch of other irrelevant classes (e.g. AccessControlException).  AccessControlException isn't useful since it doesn't implement the List interface and the code wouldn't compile.  Please filter Content Assist to only show those classes which can legally be put here.
Comment 1 Deepak Azad CLA 2012-11-07 17:20:47 EST

*** This bug has been marked as a duplicate of bug 261315 ***