Bug 217432 - [refactoring] [drc] automatically replace qualification with import
Summary: [refactoring] [drc] automatically replace qualification with import
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-02-01 08:33 EST by G. Ralph Kuntz, MD CLA
Modified: 2008-02-29 10:47 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Ralph Kuntz, MD CLA 2008-02-01 08:33:02 EST
Can you add a preference to create an "import static" if a qualified name appears more than N times?

For example, if the name X.FOO constant appears more than N times, it should be changed to FOO everywhere it appears and a static import added for X.FOO.
Comment 1 Martin Aeschlimann CLA 2008-02-04 05:50:14 EST
We have no plans for this.
It's not trivial to do. The difficulty will be to do it 100% correct. There are several corner cases with visibility, shadowing etc, which would probably require a refactoring.

We already have an action that the user can manually invoke ('add import, CTRL + M') on a qualified name. You can also add your static import 'favorites' to code assist (see preference page)
Comment 2 G. Ralph Kuntz, MD CLA 2008-02-29 10:47:30 EST
Yes, but it only replaces the one you click on, not all instances of the constant.