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 201144 - [Push Down Method] A method is not visible (compilation error)
Summary: [Push Down Method] A method is not visible (compilation error)
Status: RESOLVED WONTFIX
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:
: 201963 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-20 02:17 UTC by rohitgheyi
Modified: 2015-09-17 11:16 UTC (History)
1 user (show)

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:17:57 UTC
NetBeans IDE 7.0.1 (Build 201107282000)

Steps to reproduce: apply Push Down Method refactoring on the following program:

package p1;
public class A {
  public long m() {
    return new A().k();
  }
  protected long k() {
    return 1;
  }
}

package p2;
import p1.A;
public class B extends A {}

Push Down Method refactoring produces the uncompilable code below:

package p1;
public class A {
  protected long k() {
    return 1;
  }
}

package p2;
import p1.A;
public class B extends A {
  public long m() {
    return new A().k();
  }
}
Comment 1 Ralph Ruijs 2012-05-08 14:03:21 UTC
*** Bug 201963 has been marked as a duplicate of this bug. ***
Comment 2 Martin Balin 2015-09-17 11:16:04 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.