Bug 351507 - [plan] Incorrect imports in .java file when two pushed-in ITDs import different types with same simple name
Summary: [plan] Incorrect imports in .java file when two pushed-in ITDs import differe...
Status: NEW
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 2.1.3   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 2.2.4   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-07 23:28 EDT by Andrew Swan CLA
Modified: 2013-07-03 15:41 EDT (History)
1 user (show)

See Also:


Attachments
Minimal project to demonstrate the bug (see comment 0) (8.05 KB, application/zip)
2011-07-07 23:29 EDT, Andrew Swan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.