Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 108486 - [pull up method] PullUp method that references a field yields comp. error
[pull up method] PullUp method that references a field yields comp. error
Status: RESOLVED DUPLICATE of bug 111563
Product: java
Classification: Unclassified
Component: Refactoring
6.x
PC Windows XP
: P3 (vote)
: 6.x
Assigned To: issues@java
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-29 01:12 UTC by kely_garcia
Modified: 2007-10-12 13:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


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:12:58 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 A {
        private void m(){
            super.theField=null;
        }
        void m(    Object newArg){
            B.this.m();
        }
    }
}

Yields the following refactored code:
public class A {
    private Object theField;
    class B extends A {
        void m(    Object newArg){
            B.this.m();
        }
    }

    private void m() {
        super.theField = null;
    }
}

The compilation errors are: 
- "m(Object) cannot be applied to m()"
- "cannot find symbol: variable theField"
Comment 1 Jan Becicka 2007-10-12 13:15:13 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 ***


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