Bug 16354 - Code Assist has too many items after throws
Summary: Code Assist has too many items after throws
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 F2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-18 11:17 EDT by Kurt Kellner CLA
Modified: 2002-06-03 09:44 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Kellner CLA 2002-05-18 11:17:45 EDT
When typing the "throws" of a method declaration and using code assist to pick 
the correct Throwable class, the code assist shows ALL classes that match the 
letters you've entered.  This is incorrect.  You can only declare Throwable and 
its subclasses.  The code assist list should filter out all other classes.  

Example:

public void calculate(String value) throws Num

In the above example, if the cursor is sitting right after the "Num" and you 
press CTRL-Space, you get the code assist list that contains all classes 
like "Number", however code assist should be smart enough to know that the 
Number class is not a subclass of Throwable, and therefore is not a valid 
selection given the context.
Comment 1 Erich Gamma CLA 2002-05-25 05:49:34 EDT
if the subtype hierarchy of Throwable computation is too expensive, could we 
use the relevance support to give types ending with Exception, Error, Failure a 
higher relevance in this context?
Comment 2 Philipe Mulet CLA 2002-05-25 08:35:00 EDT
Relevance for exception types should already be in (type name ending with 
Exception or Error).

David - please double check
Comment 3 David Audel CLA 2002-05-27 06:57:09 EDT
Relevance for exception types is already in.

With this test case all the classes are in code assist list 
and "NumberFormatException" is on the top of this list.

The sorting can be different if the code assist preference 'Present proposals 
in alphabeticla order' is enabled.

Closing.
Comment 4 David Audel CLA 2002-06-03 09:44:08 EDT
Verified.