Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 177093

Summary: [encapsulate field] Encapsulating parenthesized field with unary operator yields compilation error
Product: [Eclipse Project] JDT Reporter: Brett Daniel <bdaniel3>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Brett Daniel CLA 2007-03-12 23:10:40 EDT
Build ID: I20070222-0951

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 void setF(int f) {
	this.f = f;
}
public int getF() {
	return f;
}
}

Note that "(getF())++;" is a compilation error.  Bug also appears for prefix operators.


More information:
Comment 1 Dani Megert CLA 2013-04-11 07:35:06 EDT

*** This bug has been marked as a duplicate of bug 177095 ***