This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 129683 - "Move Inner to Outer Level" generates import for moved nested class
Summary: "Move Inner to Outer Level" generates import for moved nested class
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
Depends on:
Blocks: 152192
  Show dependency tree
Reported: 2008-03-10 17:33 UTC by matthies
Modified: 2009-02-20 15:18 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2008-03-10 17:33:23 UTC

package test;

    package test;
    public interface Test {
        interface A {
            interface B {
                void g(A a);
            void f(B b);

Applying "Move Inner to Outer Level" to A generates the following:

    package test;

    import test.Test.A.B;

    public interface A {
        public static interface B {
            void g(A a);

        void f(B b);

The import statement references the previous location of the nested class B that was moved with A, causing a compile 

As a minor point, it's inconsistent that "public" is being added to "interface B" but not to f() and g().

Product Version: NetBeans IDE 6.1 Beta (Build 200803050202)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Comment 1 Jiri Prox 2008-04-11 01:46:44 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 2 Max Sauer 2009-02-20 15:18:22 UTC
Seems to be fixed in

Product Version: NetBeans IDE Dev (Build 20090206071818)
Java: 1.6.0_07; Java HotSpot(TM) 64-Bit Server VM 1.6.0_07-b06-57
System: Mac OS X version 10.5.6 running on x86_64; MacRoman; en_US (nb)

New interface file created, no unnecessary import added.