Bug 150561 - [move static members] should remove unnecessary member qualifiers
Summary: [move static members] should remove unnecessary member qualifiers
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.8   Edit
Hardware: All All
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 120583 409592 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-13 15:25 EDT by Luke Hutchison CLA
Modified: 2018-09-14 05:30 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Hutchison CLA 2006-07-13 15:25:21 EDT
class A {
    public static final int CONST = 0;
    public static final int CONST2 = CONST;
}

class B {
    public static final int CONST3 = A.CONST;
}


Moving CONST to class B gives:




class A {
    public static final int CONST2 = B.CONST;  // as expected
}

class B {
    public static final int CONST = 0;
    public static final int CONST3 = B.CONST;  // the "B." is superfluous
}


Perhaps there should be a switch in the Move dialog to remove superfluous qualifiers after the move?
Comment 1 Dani Megert CLA 2006-07-13 17:04:13 EDT
Please provide more details.
http://www.eclipse.org/eclipse/platform-text/development/bug-incomplete.htm
Comment 2 Luke Hutchison CLA 2006-07-13 17:22:10 EDT
Sorry there is no long explanatory text, I figured the annotated example was self-explanatory.  See "Moving CONST to class B gives:" between the "before" and "after" examples, and "// the "B." is superfluous".

The problem is that "A.CONST" in class B gets replaced with "B.CONST" once CONST is moved into class B.  While the code is valid, the "B." is superfluous.
Comment 3 Markus Keller CLA 2010-01-25 08:38:02 EST
*** Bug 120583 has been marked as a duplicate of this bug. ***
Comment 4 Markus Keller CLA 2013-05-31 10:30:11 EDT
*** Bug 409592 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2013-05-31 10:33:53 EDT
See also bug 112999.
Comment 6 Palmer Eldritch CLA 2013-11-18 13:02:56 EST
Maybe the root cause of https://bugs.eclipse.org/bugs/show_bug.cgi?id=421969