Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351507

Summary: [plan] Incorrect imports in .java file when two pushed-in ITDs import different types with same simple name
Product: [Tools] AJDT Reporter: Andrew Swan <aswan>
Component: UIAssignee: AJDT-inbox <AJDT-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: andrew.eisenberg
Version: 2.1.3   
Target Milestone: 2.2.4   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Minimal project to demonstrate the bug (see comment 0) none

Description Andrew Swan CLA 2011-07-07 23:28:51 EDT
Build Identifier: 201107041000

If two ITDs refer to two separate Java types with the same simple name but in different packages, then pushing those ITDs into the target Java class will result in only one of those types being referenced (the other type being ignored).

Reproducible: Always

Steps to Reproduce:
1. Extract the ZIP file I'm about to attach containing a sample minimal Eclipse project.
2. Note there are two ITDs, one importing demo.lib1.Called and the other importing demo.lib2.Called, and that The target type Target.java is empty.
3. In Eclipse, right-click the project and use Refactor > Push In to push in both ITDs at once.
4. The resulting Java class does not compile because only demo.lib1.Called is imported; the reference to the other class of this name should be in fully qualified form, i.e. should say "demo.lib2.Called.bar()", not "Called.bar()".
Comment 1 Andrew Swan CLA 2011-07-07 23:29:43 EDT
Created attachment 199304 [details]
Minimal project to demonstrate the bug (see comment 0)
Comment 2 Andrew Eisenberg CLA 2011-07-11 16:20:23 EDT
Thanks for the test case.  I'll have a look at it for the 2.2.0 release.
Comment 3 Andrew Eisenberg CLA 2011-07-11 16:20:36 EDT
Thanks for the test case.  I'll have a look at it for the 2.2.0 release.
Comment 4 Andrew Eisenberg CLA 2012-07-08 18:09:43 EDT
Consider for the 2.2.1 release.
Comment 5 Andrew Swan CLA 2012-07-08 19:44:14 EDT
Happy birthday, this bug! :-)
Comment 6 Andrew Eisenberg CLA 2012-09-21 14:00:07 EDT
Consider for 2.2.2.
Comment 7 Andrew Eisenberg CLA 2013-02-22 13:56:33 EST
Moving to 2.2.3.
Comment 8 Andrew Eisenberg CLA 2013-07-03 15:41:43 EDT
Consider for the 2.2.4 release.