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 201963 - [push down method] introduces compilation error: The method from the type is not visible
Summary: [push down method] introduces compilation error: The method from the type ...
Status: RESOLVED DUPLICATE of bug 201144
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-09-11 23:59 UTC by GustavoSoares
Modified: 2012-05-08 14: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 GustavoSoares 2011-09-11 23:59:33 UTC
Create the classes:
package p2;
import p1.*;
public class C extends A {
  public long test(){
    return m();
  }
}
package p1;
public class B extends A {
  public long k(  long a){
    return 0;
  }
}
package p1;
public class A {
  protected long k(  int a){
    return 1;
  }
  public long m(){
    return new A().k(2);
  }
}
apply the push down method refactoring to m

package p2;
import p1.*;
public class C extends A {
  public long test(){
    return m();
  }

    public long m() {
        return new A().k(2);
    }
}


package p1;
public class B extends A {
  public long k(  long a){
    return 0;
  }

    public long m() {
        return new A().k(2);
    }
}


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

The resulting program does not compile.
Comment 1 Ralph Ruijs 2012-05-08 14:03:21 UTC

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