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 201141 - [Encapsulate Field] Cannot reduce the visibility of the inherited method (compilation error)
Summary: [Encapsulate Field] Cannot reduce the visibility of the inherited method (com...
Status: RESOLVED DUPLICATE of bug 108473
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.0.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-20 02:02 UTC by rohitgheyi
Modified: 2011-10-10 12:20 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 rohitgheyi 2011-08-20 02:02:59 UTC
NetBeans IDE 7.0.1 (Build 201107282000)

Steps to reproduce: apply Encapsulate Field refactoring on the following program:

public class A {
  public long f;
}
public class B extends A {
  long getF() {
    return 0;
  }
}

Encapsulate Field refactoring produces the uncompilable code below:

public class A {
  public long f;
  public long getF() {
    return f;
  }
  public void setF(long f) {
    this.f = f;
  }
}
public class B extends A {
  long getF() {
    return 0;
  }  	
}
Comment 1 Ralph Ruijs 2011-10-10 12:20:52 UTC

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