Bug 16354

Summary: Code Assist has too many items after throws
Product: [Eclipse Project] JDT Reporter: Kurt Kellner <kkellner>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 F2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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.