Bug 54409 - ICompilationUnit should provide a getImport(..) method that uses the simple name
Summary: ICompilationUnit should provide a getImport(..) method that uses the simple name
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.3   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-10 17:53 EST by Vikas Trivedi CLA
Modified: 2006-10-13 09:46 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 Vikas Trivedi CLA 2004-03-10 17:53:17 EST
Currently ICompilationUnit provides a getImport(..) method that expects a fully 
qualified name for it to be able to return useful information.
Instead ICompilationUnit should (also) provide a method that uses just the 
simple name. This will allow the client to know whether any existing imports 
will incorrectly resolve the simple name being used. If so the Client could be 
careful and then use the fullyqualified name instead and avoid problems. 
Currently there is no way to detect such a potential problem.
Comment 1 Philipe Mulet CLA 2004-03-25 06:40:49 EST
Will reconsider post 3.0
Comment 2 Philipe Mulet CLA 2006-09-08 03:59:37 EDT
Why don't you simply iterate all imports using ICompilationUnit#getImports() and play whatever logic you want ?

#getImport(...) is spec'ed as a convenience method (ie. helper), and all you are asking is a further subsequent helper method, which in my opinion doesn't add much value, since it must answer a collection/array of matching candidate, which is just allocating one extra array etc...

Basically, this cannot be blocking you; suggest you provide a patch for what you really have in mind; and if killer functionality addition, then we may consider it. If not, then we will leave it to client to play whatever semantics when iterating imports. 

This is similar to our rules for navigating throughout the model.
Comment 3 Philipe Mulet CLA 2006-10-13 09:41:00 EDT
Talked with Vikas, he agreed with previous comment.
No action planned.
Comment 4 Philipe Mulet CLA 2006-10-13 09:46:30 EDT
closing