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 98054 - [encapsulate field] Encapsulating parenthesized field with unary operator yields compilation error
Summary: [encapsulate field] Encapsulating parenthesized field with unary operator yie...
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 03:26 UTC by kely_garcia
Modified: 2007-10-15 13:03 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 03:26:34 UTC
Build ID: 200609161800 (Netbeans 6.0 M3)

Steps To Reproduce:
Encapsulate field f on the following:

public class A {
  int f;
  void m(){
    (f)++;
  }
}

Yields the following refactored code:
public class A {
  private int f;
  void m(){
    (getF())++;
  }

    public int getF() {
        return f;
    }

    public void setF(int f) {
        this.f = f;
    }
}

Note that "(getF())++;" is a compilation error.  Bug also appears for prefix
operators.
Comment 1 Pavel Flaska 2007-03-23 09:02:14 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:03:04 UTC
Already implemented. Please try the latest daily build.