Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 98057 - [encapsulate field] Encapsulating a field referenced by a super call is not performed correctly
[encapsulate field] Encapsulating a field referenced by a super call is not p...
Status: RESOLVED FIXED
Product: java
Classification: Unclassified
Component: Refactoring
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Jan Pokorsky
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-16 04:19 UTC by kely_garcia
Modified: 2007-10-15 13:28 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-03-16 04:19:25 UTC
Build ID: 200609161800 (Netbeans 6.0 M3)

Steps To Reproduce:
Encapsulate field f on the following:

class A {
        int f;
}
class B extends A {
        void m() {
                super.f = 0; 
        }
}

Yields the following refactored code:
class A {
        private int f;

    public int getF() {
        return f;
    }

    public void setF(int f) {
        this.f = f;
    }
}
class B extends A {
        void m() {
                setF(0); 
        }
}

Note: Instead of changing "super.f = 0" to "super.setF(0)" it was changed 
to "setF(0)"
Comment 1 Pavel Flaska 2007-03-23 13:14:38 UTC
Encapsulate field refactoring is not available in current builds. It has to be
brought back with fixes.
Comment 2 Jan Pokorsky 2007-10-15 13:28:39 UTC
Already implemented. Please try the latest daily build.

Note that the result depends also on your Field Visibility and Use Accessors Visibility settings.


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