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 98848 - [Move Inner To Outer Level] Move Inner Class B which has an expression that involves field A.f yields compilation error
Summary: [Move Inner To Outer Level] Move Inner Class B which has an expression that i...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-23 20:17 UTC by kely_garcia
Modified: 2008-11-18 16: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 kely_garcia 2007-03-23 20:17:27 UTC
Build ID: 200609161800 (Netbeans 6.0 M3)

Steps To Reproduce:
Move Inner Class B on the following declaring field "a" for the outer class

public class A {
    public int f;        
    class B {
        public void dummyMethod_B(){                        
            int g= f;
        }
    }
}

Yields the following refactored class B:
class B {
    public B(A a) {
        this.a = a;
    }

    private final A a;

    public void dummyMethod_B(){                        
        int g = f;
    }
}

Compilation error is the following: "cannot find symbol: variable f"
Comment 1 kely_garcia 2007-04-08 00:32:53 UTC
Note: The same problem happens with methods. For example: Move Inner 
Class 'Inner' on the following:
class A 
{
	private int foo() {return 0;}
	public class Inner
	{
		Inner() {
			int f= foo();
		}
	}	
}

yields the following refactored class Inner:
public class Inner
{
    private final A a;

    Inner(A a) {
        this.a = a;
        int f = foo();
    }
}
Compilation error is the following: "cannot find symbol: method foo"
Comment 2 Jan Becicka 2007-04-23 09:38:53 UTC
Move Inner To Outer Level not implemented in 6.0 so far.
Comment 3 Jiri Prox 2008-04-11 01:49:35 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 4 Jan Pokorsky 2008-11-18 16:35:50 UTC
fixed in NB 6.5