Bug 12082 - Refactoring - extensions to Move class [refactoring]
Summary: Refactoring - extensions to Move class [refactoring]
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
: 12414 22462 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-03-21 19:17 EST by Jeff Brown CLA
Modified: 2003-02-17 08:20 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Brown CLA 2002-03-21 19:17:15 EST
Sometimes in the course of refactoring, I'll realize that I've got
an inner class that does not reference the outer class's fields in
any way, so I mark it 'static'.  Later on, I want to move this static
inner class to its own compilation unit, or (rarely) to inside some
other class.

In the most common case, Inner has no references to any members
or fields of Outer, and all I want to do is grab it and create
a new compilation unit.
e.g.
  public class Outer {
    // stuff
    public static class Inner {
      // other stuff
    }
  }

Just supporting this behaviour would be good enough, except
sometimes (rarely), Inner references some static fields or members
of Outer.  In which case, precondition checking would have to
verify that they are visible from the new location, and the refactoring
would expand the scoped references as needed for the new context.
Comment 1 Erich Gamma CLA 2002-03-22 03:24:56 EST
agreed that this would be useful, but cannot committ to it for 2.0
Comment 2 Eric Nickell CLA 2002-06-11 16:29:53 EDT
Related to Bug 6502 and others.
Comment 3 Dirk Baeumer CLA 2002-07-23 10:22:17 EDT
[refactoring]

This is "Create Outer class from static inner class"

Consider for 2.1
Comment 4 Dirk Baeumer CLA 2002-07-23 10:35:25 EDT
*** Bug 12414 has been marked as a duplicate of this bug. ***
Comment 5 Dirk Baeumer CLA 2002-08-21 05:49:27 EDT
*** Bug 22462 has been marked as a duplicate of this bug. ***
Comment 6 Dirk Baeumer CLA 2002-08-21 05:50:00 EDT
From bug 22462

For non-static inner classes, the implicit reference to the outer class
should be made explicit if required.

I guess initialy the refactoring could be allowed only when the inner class
doesn't use non-public features of the outer class.
Comment 7 Adam Kiezun CLA 2002-09-17 18:31:18 EDT
iin the build