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 240200 - [Move inner to outer] Inner class is not removed after move
Summary: [Move inner to outer] Inner class is not removed after move
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-10 10:35 UTC by Jiri Prox
Modified: 2014-01-22 02:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2014-01-10 10:35:54 UTC
Class defined inside method body is not removed after performing Inner to Outer move. This may cause in-compilable code.

Steps to reproduce:
1) have a code:
public class NewClass {
    
    public void m() {
        class Inner {
            int x;
            public void mm() {
                
            }

            public Inner() {
            }
            
            
        };
        Inner i = new Inner();        
    }
}

2) move Inner class to outer level (keep defaults)

-> 
public class NewClass {
    
    public void m() {
        class Inner {
            int x;
            public void mm() {
                
            }

            public Inner() {
            }
            
            
        };
        Inner i = new Inner(this);    //<- syntax error    
    }
}


Product Version: NetBeans IDE 8.0 Beta (Build 201401100215)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b49
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b107
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\8.0beta
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\8.0beta
Comment 1 Ralph Ruijs 2014-01-21 09:12:19 UTC
changeset:   7425c57bd0b0
user:        Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date:        Mon Jan 13 13:22:29 2014 +0100
summary:     #240200 - [Move inner to outer] Inner class is not removed after move
Comment 2 Quality Engineering 2014-01-22 02:35:15 UTC
Integrated into 'main-silver', will be available in build *201401220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7425c57bd0b0
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #240200 - [Move inner to outer] Inner class is not removed after move