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 195947 - Some unexpected error occurred during "Refactor -> Move Inner to Outer Level..."
Summary: Some unexpected error occurred during "Refactor -> Move Inner to Outer Level..."
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Becicka
URL: http://wiki.netbeans.org/STS_68_Refac...
Keywords:
: 196194 196397 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-24 15:31 UTC by ttokoly
Modified: 2011-03-17 11:13 UTC (History)
2 users (show)

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 ttokoly 2011-02-24 15:31:12 UTC
1. Unzip a project ConvertClasses to some work directory - there is link:
http://wiki.netbeans.org/wiki/images/b/be/ConvertClasses_STS_68_Refactoring.zip
2. Start IDE with a clean userdir
3. Invoke File | Open Project... action
4. Select unzipped projects default
5. Scanning structure of project should be performed (It takes a while)

6. Call Move Inner to Outer Level for class Inner2 located in OuterClass
7. Keep all options as default
8. Click Preview, review all changes and confirm by Do Refactoring

According to Refactoring Sanity Test Specifications ( http://wiki.netbeans.org/STS_68_Refactoring -> Inner to Outer - static class ) there be should be no errors, but two errors appears:

Cannot refactor "out.getInner". Use "Declare Field" option.
Cannot refactor "OutterClass.Inner1". Use "Declare Field" option.

Note: "Declare Field" option is disabled.
Note: Works same on Windows XP.

Product Version: NetBeans IDE Dev (Build 201102240001)
Java: 1.7.0-ea; Java HotSpot(TM) Client VM 21.0-b02
System: Linux version 2.6.32-28-generic running on i386; UTF-8; en_US (nb)
Comment 1 Jan Becicka 2011-02-25 13:23:09 UTC
Changeset: http://hg.netbeans.org/jet-main/rev/cfd51c289e8b
Author:    Jan Becicka <jbecicka@netbeans.org>
Date:      2011-02-25 14:19
Message:   
Issue #195947 - Some unexpected error occurred during "Refactor -> Move Inner to Outer Level..."
Comment 2 Quality Engineering 2011-02-26 05:13:03 UTC
Integrated into 'main-golden', will be available in build *201102260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/cfd51c289e8b
User: Jan Becicka <jbecicka@netbeans.org>
Log: Issue #195947 - Some unexpected error occurred during "Refactor -> Move Inner to Outer Level..."
Comment 3 Jan Becicka 2011-03-03 12:06:12 UTC
*** Bug 196194 has been marked as a duplicate of this bug. ***
Comment 4 matthies 2011-03-03 18:06:03 UTC
With the example class from issue 196194, the result for the outer class is now:

    public class Example
    {
        private final int foo;

        public Example() { Example.this.foo = 0; }
    }

I.e. "this.foo" has been replaced by "Example.this.foo", which is not valid and causes a compiler error.
Comment 5 Jan Becicka 2011-03-04 10:10:01 UTC
Changeset: http://hg.netbeans.org/jet-main/rev/d14f72f91e82
Author:    Jan Becicka <jbecicka@netbeans.org>
Date:      2011-03-04 10:59
Message:   
Issue #195947 - Some unexpected error occurred during "Refactor -> Move Inner to Outer Level..."
Comment 6 Quality Engineering 2011-03-05 05:43:25 UTC
Integrated into 'main-golden', will be available in build *201103050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d14f72f91e82
User: Jan Becicka <jbecicka@netbeans.org>
Log: Issue #195947 - Some unexpected error occurred during "Refactor -> Move Inner to Outer Level..."
Comment 7 Jan Becicka 2011-03-07 16:11:23 UTC
*** Bug 196397 has been marked as a duplicate of this bug. ***
Comment 8 ttokoly 2011-03-17 11:13:43 UTC
Product Version: NetBeans IDE 7.0 RC1 (Build 201103160000)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
Java: 1.7.0-ea; Java HotSpot(TM) Client VM 21.0-b02
System: Linux version 2.6.32-29-generic running on i386; UTF-8; en_US (nb)

Verified - works for me. On both JDK versions.