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 108488 - [pull up method] PullUp a method that references a private field yields comp. error
Summary: [pull up method] PullUp a method that references a private field yields comp....
Status: RESOLVED DUPLICATE of bug 111563
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-29 01:26 UTC by kely_garcia
Modified: 2007-10-12 13:00 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-06-29 01:26:16 UTC
Build ID: Netbeans 6.0 M9 (070502)

Steps To Reproduce:
Pull up method m on the following: 

public class A {
    private Object theField;
    class B extends C {
        public void m(){
            new A().theField=null;
        }
        void mPrime(){
            m();
        }
    }
}
class C {
    private Object theField;
}

Yields the following refactored code:

public class A {
    private Object theField;
    class B extends C {
        public void m(){
            new A().theField=null;
        }
        void mPrime(){
            m();
        }
    }
}
class C {
    private Object theField;
}

The compilation error is: "theField has private access in A"
Comment 1 Jan Becicka 2007-10-12 13:00:45 UTC
This is the same problem as 111563. Pullup does not handle references inside bodies at all. Current implementation is
simply not smart enough.

*** This issue has been marked as a duplicate of 111563 ***