Bug 30600

Summary: incorrect code assist after 'throw new'
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: David Audel <david_audel>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Adam Kiezun CLA 2003-01-30 08:11:52 EST
20030128
class Test{
	void foo(){
		throw new <<CODE ASSIST HERE
	}
}

inserts Test right away.
2 problems:

a.Test is not a subclass of Throwable, so it makes no sense
b.more than 1 proposal should be presented

--
side note:
it's incorrect after any 'new', I think - it always just puts in the name of 
the enclosing class
Comment 1 David Audel CLA 2003-02-04 06:53:32 EST
Current behavior :
- if there is at least a character then all types are proposed. Otherwise only 
enclosings types and top level types of the current unit are proposed (avoid to 
suggest all types of the workspace).
- in a 'throw' statement all possible types are proposed, but relevance of 
exceptions is higher. Currently a proposed type is considered as an exception 
if his name contains 'exception' or 'error' (compute hierarchy is too costly).

So, all seems to work as design ;)

Adam - Any comment ? If there is no comment, i close this bug.
Comment 2 Adam Kiezun CLA 2003-02-04 06:56:35 EST
ok to close then
Comment 3 David Audel CLA 2003-02-04 07:07:57 EST
closing.