Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 83293 - (3.1 I20050111-1300) Rename refactoring renames extra methods when there is a common subclass
Summary: (3.1 I20050111-1300) Rename refactoring renames extra methods when there is a...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-20 07:14 EST by David Gates CLA
Modified: 2005-01-20 13:05 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Gates CLA 2005-01-20 07:14:54 EST
---BugDemo.java---
interface A {
	void method();
}
interface B {
	void method();
}
interface ExtendsBoth extends A, B {
}

when either A.method() or B.method() is renamed to "renamed()", result is:

---BugDemo.java---
interface A {
	void renamed();
}
interface B {
	void renamed();
}
interface ExtendsBoth extends A, B {
}

Instead, should change only one or give a warning.
Comment 1 Dirk Baeumer CLA 2005-01-20 12:39:32 EST
This is a long ongoing debate whether the two methods are related to each other
or not by having the interface ExtendsBoth.

Markus, we discussed this a couple of times. Depending on our final conclusion
either mark the bug as fixed or as won't fix ;-).
Comment 2 Markus Keller CLA 2005-01-20 13:05:10 EST
We decided that the two methods are indeed related. Consider a class Client:
class Client {
    void callMethod(ExtendsBoth eb) {
        eb.method();
    }
}

The call eb.method() really calls both of the (abstract) methods and it can
expect that the contracts in the javadocs of both A#method() and B#methods() are
satisfied. Renaming just one of them alone would introduce a semantic shift.

Furthermore, interfaces are meant to be implemented, and as soon as a subclass
of ExtendsBoth implements #method(), the two methods from A and B are clearly
related.