Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 98056 - [Encapsulate fields] Encapsulate field on byte with unary operator yields compilation error
[Encapsulate fields] Encapsulate field on byte with unary operator yields com...
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:11 UTC by kely_garcia
Modified: 2007-08-30 10:45 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:11:22 UTC
Build ID: 200609161800 (Netbeans 6.0 M3)

Steps To Reproduce:
Encapsulate field b on the following (field b can be of type: byte or short or 
char):
class A {
  byte b;

  void m() {
    b++;
  }
}

Yields the following refactored class:
class A {
  private byte b;

  void m() {
    setB(getB() + 1);
  }

    public byte getB() {
        return b;
    }

    public void setB(byte b) {
        this.b = b;
    }
}

Compilation error is the following: setB(byte) cannot be applied to (int)
Comment 1 Pavel Flaska 2007-03-23 09:05:23 UTC
Encapsulate field refactoring is not available in current builds. It has to be
brought back with fixes.
Comment 2 Jan Pokorsky 2007-08-30 10:45:59 UTC
fixed in

/cvs/refactoring/java/src/org/netbeans/modules/refactoring/java/plugins/EncapsulateFieldRefactoringPlugin.java
new revision: 1.6; previous revision: 1.5


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