Bug 134721

Summary: [move static members] unable to move static member from one inner class to another [refactoring]
Product: [Eclipse Project] JDT Reporter: Max Gilead <max.gilead>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: markus.kell.r, nikolaymetchev
Version: 3.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Max Gilead CLA 2006-04-04 07:52:46 EDT
It's impossible to move static member from one inner class to another -- on below example CONSTANT can't be moved from class A to B using Refactor->Move tool:


public class Foo {
  public static class A {
    public static final String CONSTANT = "";
  }
  public static class B {}
}
Comment 1 Markus Keller CLA 2011-06-09 06:38:46 EDT
This works fine if you enter the fully-qualified name for B (e.g. using Content Assist). Only thing to do is to support the unqualified type name.

The fix is to use declaring.resolveType() in MoveMembersWizard.MoveMembersInputPage#addDestinationControls(Composite) and in MoveStaticMembersProcessor#resolveType(String).