Bug 217432

Summary: [refactoring] [drc] automatically replace qualification with import
Product: [Eclipse Project] JDT Reporter: G. Ralph Kuntz, MD <grk>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: martinae
Version: 3.3.1Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

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.