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 98847 - [Move Inner To Outer Level] Move Inner Class B yields compilation error
Summary: [Move Inner To Outer Level] Move Inner Class B yields compilation error
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-23 20:01 UTC by kely_garcia
Modified: 2009-02-19 22:58 UTC (History)
1 user (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 kely_garcia 2007-03-23 20:01:10 UTC
Build ID: 200609161800 (Netbeans 6.0 M3)

Steps To Reproduce:
Move inner class B to outer level on the following without declaring a field 
for the outer class

public class A {
    class B {
        public void dummyMethod_B(){
            Object dummyVariable_dummyMethod_B=A.this;
        }
    }
}

Yields the following refactored class B:
class B {
    public void dummyMethod_B(){
        Object dummyVariable_dummyMethod_B = A.this;
    }
}

Compilation error is the following: "not an enclosing class: A"
Comment 1 Jan Becicka 2007-04-23 09:40:35 UTC
Move Inner To Outer Level not implemented in 6.0 so far.
Comment 2 Jan Becicka 2007-12-13 16:36:40 UTC
Checking in InnerToOuterRefactoringPlugin.java;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/InnerToOuterRefactoringPlugin.java,v  <-- 
InnerToOuterRefactoringPlugin.java
new revision: 1.18; previous revision: 1.17
done
Checking in InnerToOuterTransformer.java;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/InnerToOuterTransformer.java,v  <-- 
InnerToOuterTransformer.java
new revision: 1.21; previous revision: 1.20
done
Checking in Bundle.properties;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/Bundle.properties,v  <--  Bundle.properties
new revision: 1.26; previous revision: 1.25
done
Comment 3 Jiri Prox 2008-02-07 14:19:46 UTC
this still does not work correctly in current daily build

now it generates code:
Object dummyVariable_dummyMethod_B = outer.this;

instead of:
Object dummyVariable_dummyMethod_B = outer;

Product Version: NetBeans IDE Dev (Build 20080207041452)
Java: 1.6.0_05-ea; Java HotSpot(TM) Client VM 1.6.0_05-ea-b06
System: Linux version 2.6.5-1.358 running on i386; UTF-8; en_US (nb)
Comment 4 Jiri Prox 2008-04-11 01:49:26 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 5 Jan Pokorsky 2008-11-19 09:46:54 UTC
fixed http://hg.netbeans.org/main/rev/9d74d7cb66ce
Comment 6 Quality Engineering 2008-11-19 16:41:52 UTC
Integrated into 'main-golden', will be available in build *200811191401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/9d74d7cb66ce
User: Jan Pokorsky <jpokorsky@netbeans.org>
Log: #98847: resolve 'Outer.this' as 'outer' reference in moved class