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

Bug 69700

Summary: "Use supertype" blocks with inherited methods [refactoring]
Product: [Eclipse Project] JDT Reporter: Friedrich Steimann <steimann>
Component: UIAssignee: Tobias Widmer <tobias_widmer>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Sample project reproducing the problem none

Description Friedrich Steimann CLA 2004-07-09 03:52:20 EDT
Version: 3.0.0
Build id: 200407090010

"Use Supertype" does not replace var's type by interface with identical 
protocol if class inherits a method from a superclass.

public class A {
    public void m(){    
    }
}

public interface I {
    void m();
    void n();
}

public class B extends A implements I {
	public void n() {
	}
	public void doIt() {
		B b = new B();
		b.m();
		b.n();
	}
}

Refuses to replace B with I. Works if m() is overridden in B.

Is this a feature?

-- Friedrich
Comment 1 Friedrich Steimann CLA 2004-07-09 03:53:25 EDT
Created attachment 13090 [details]
Sample project reproducing the problem
Comment 2 Markus Keller CLA 2004-08-27 11:54:07 EDT
Probably due to bug 41989.
Comment 3 Dirk Baeumer CLA 2005-05-25 09:29:24 EDT
Tobias, can you please check the state of this bug (since you recoded use
supertype).
Comment 4 Tobias Widmer CLA 2005-05-25 12:36:31 EDT
See my comment in bug 41989. The new implementation at least does not generate 
compile errors.