Bug 420510 - [rename] "Rename package" refactoring drops 2nd static import of method with same name but different signature
Summary: [rename] "Rename package" refactoring drops 2nd static import of method with ...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3.1   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-28 10:52 EDT by Volker Stolz CLA
Modified: 2022-09-23 05:00 EDT (History)
5 users (show)

See Also:
manju656: review? (manju656)


Attachments
sample project (20.00 KB, application/x-tar)
2013-10-28 10:52 EDT, Volker Stolz CLA
no flags Details
Fix and Tests (6.05 KB, patch)
2013-11-05 20:01 EST, Samrat Dhillon CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Stolz CLA 2013-10-28 10:52:26 EDT
Created attachment 236957 [details]
sample project

Sample code:

package b;
import static a.A.foo;
import static a.B.foo;
public class C {
  public void test() {
	  foo();
	  foo("hello");
  }
}

If now package "a" is renamed e.g. to "x", the 2nd static import will disappear, leading to a compilation error. I suspect someone is too eagerly filtering duplicate imports.
Comment 1 Srikanth Sankaran CLA 2013-10-28 10:54:47 EDT
Move to JDT/UI for comment.
Comment 2 Samrat Dhillon CLA 2013-11-05 20:01:49 EST
Created attachment 237219 [details]
Fix and Tests

Passing false to ImportRewrite#addStaticImport for isField seems to fix this.

This contribution complies with http://www.eclipse.org/legal/CoO.php
Comment 3 Eclipse Genie CLA 2020-08-13 11:52:32 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Jeff Johnston CLA 2020-08-13 13:59:27 EDT
This bug still occurs in latest Eclipse.
Comment 5 Eclipse Genie CLA 2022-09-23 05:00:01 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.