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 198186 - "Move inner to outer level" bad code and syntax errors
Summary: "Move inner to outer level" bad code and syntax errors
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on: 197097
Blocks:
  Show dependency tree
 
Reported: 2011-04-28 17:52 UTC by err
Modified: 2011-08-04 13:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
refactor this java file (1.42 KB, text/plain)
2011-04-28 17:52 UTC, err
Details

Note You need to log in before you can comment on or make changes to this bug.
Description err 2011-04-28 17:52:17 UTC
Created attachment 108007 [details]
refactor this java file

I've attached a case to reproduce the problems.
To reproduce do "move inner to outer" of class StartAsNested. There are syntax errors and one case where incorrect code is prduced.

These problems show up:
- Bad code is produced.
  StartAsNested.java:35 should be

        public MyC1(int i)
        {
            super(i); <<<<<<<<<<<<< missing in refactored result
        }

- TestCase.java:16
  Should be this.changeNotify...

- StartAsNested.java:23
  Actually, I don't mind this; then I can decide to
  either make outer final or change the code to:
                this.outer.changeNotify.change();

- StartAsNested.java:30
  StartAsNested.java:57

        C1 c = outer.new MyC1(1);


Product Version: NetBeans IDE 7.0 (Build 201104080000)
Java: 1.6.0_23; Java HotSpot(TM) Client VM 19.0-b09
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\7.0
Comment 1 Jan Becicka 2011-07-25 13:51:47 UTC
Ralph, please take a look at this one, thanks.
Comment 2 Ralph Ruijs 2011-08-02 09:35:48 UTC
I added a dependency to #197097 for the missing super() call.
Comment 3 Ralph Ruijs 2011-08-02 09:36:44 UTC
Changeset: a10666d51e59
Author:    Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Date:      2011-08-02 11:32
Message:   
Issue #198186 - "Move inner to outer level" bad code and syntax errors
Comment 4 Quality Engineering 2011-08-04 13:49:59 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/a10666d51e59
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: Issue #198186 - "Move inner to outer level" bad code and syntax errors