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

Bug 356679

Summary: [rename class] Renaming a class leads to compilation error: The method is undefined for the type
Product: [Eclipse Project] JDT Reporter: Gustavo Soares <gsoares>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Gustavo Soares CLA 2011-09-04 11:24:14 EDT
Build Identifier: 20110615-0604 

Renaming a class may lead to a compilation error: The method  is undefined for the type

Reproducible: Always

Steps to Reproduce:
1. Create the classes:
package p2;
import p1.*;
public class C extends A {
  protected long k(  long a){
    return 1;
  }
  public long k(  int a){
    return 0;
  }
}
package p1;
public class B extends A {
}
package p1;
import p2.*;
public class A {
  public long m(){
    return new C().k(2);
  }
}
2. Apply the rename class refactoring to rename B to C
package p1;
import p2.*;
public class A {
  public long m(){
    return new C().k(2);
  }
}

package p1;
public class C extends A {
}

package p2;
import p1.*;
public class C extends A {
  protected long k(  long a){
    return 1;
  }
  public long k(  int a){
    return 0;
  }
}
3. The resulting code does not compile: The method  k(int) is undefined for the type C
Comment 1 Markus Keller CLA 2011-09-05 12:16:54 EDT
Same underlying problem as bug 356677.

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