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 201154 - [Change Method Parameter] Change Accessibility - Increase method visibility enables overriding (behavioral change)
Summary: [Change Method Parameter] Change Accessibility - Increase method visibility e...
Status: RESOLVED DUPLICATE of bug 201140
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.0.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-20 16:59 UTC by rohitgheyi
Modified: 2011-08-30 13: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 16:59:01 UTC
NetBeans IDE 7.0.1 (Build 201107282000)

Steps to reproduce: apply Change Method Parameter refactoring on the following program:

public class A {
  private int k() {
    return 1;
  }
  int m() {
    return k();
  }    
}
public class B extends A {
  int k() {
    return 2;
  }
  int test() {
    return m();
  }
}

Change Method Parameter refactoring introduces a behavioral change. In the previous program, the method test yields 1. In the following program, the method test yields 2 when an instance of B calls it.

public class A {
  int k() {
    return 1;
  }
  int m() {
    return k();
  }    
}
public class B extends A {
  int k() {
    return 2;
  }
  int test() {
    return m();
  }
}
Comment 1 Jan Becicka 2011-08-29 13:42:53 UTC
please evaluate. Thanks
Comment 2 Ralph Ruijs 2011-08-30 13:19:25 UTC

*** This bug has been marked as a duplicate of bug 21140 ***
Comment 3 Ralph Ruijs 2011-08-30 13:20:33 UTC

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