Bug 54409

Summary: ICompilationUnit should provide a getImport(..) method that uses the simple name
Product: [Eclipse Project] JDT Reporter: Vikas Trivedi <vtrivedi>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.0   
Target Milestone: 3.3   
Hardware: All   
OS: All   
Whiteboard:

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