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 98056 - [Encapsulate fields] Encapsulate field on byte with unary operator yields compilation error
Summary: [Encapsulate fields] Encapsulate field on byte with unary operator yields com...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
Depends on:
Blocks:
 
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
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-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