Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 98847 - [Move Inner To Outer Level] Move Inner Class B yields compilation error
[Move Inner To Outer Level] Move Inner Class B yields compilation error
Product: java
Classification: Unclassified
Component: Refactoring
All All
: P3 (vote)
: 6.x
Assigned To: Jan Pokorsky
Depends on:
  Show dependency treegraph
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


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;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/,v  <--
new revision: 1.18; previous revision: 1.17
Checking in;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/,v  <--
new revision: 1.21; previous revision: 1.20
Checking in;
/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/,v  <--
new revision: 1.26; previous revision: 1.25
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
Comment 6 Quality Engineering 2008-11-19 16:41:52 UTC
Integrated into 'main-golden', will be available in build *200811191401* on (upload may still be in progress)
User: Jan Pokorsky <>
Log: #98847: resolve 'Outer.this' as 'outer' reference in moved class

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo