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

Summary: "Move Inner to Outer Level" generates import for moved nested class
Product: java Reporter: matthies <matthies>
Component: RefactoringAssignee: issues@java <issues>
Status: RESOLVED WORKSFORME    
Severity: blocker CC: msauer
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 152192    

Description matthies 2008-03-10 17:33:23 UTC
Example:

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 
error.

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.