Bug 420510

Summary: [rename] "Rename package" refactoring drops 2nd static import of method with same name but different signature
Product: [Eclipse Project] JDT Reporter: Volker Stolz <stolz+bugzilla>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: minor    
Priority: P3 CC: erlend.k, jjohnstn, manju656, samrat.dhillon, srikanth_sankaran
Version: 4.3.1Flags: manju656: review? (manju656)
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
sample project
none
Fix and Tests none

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.