Bug 399183 - [Rename class] Strong precondition: Another type named C is referenced in C.java
Summary: [Rename class] Strong precondition: Another type named C is referenced in C.java
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Mac OS X
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-26 17:59 EST by Gustavo Soares CLA
Modified: 2016-09-23 08:20 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Soares CLA 2013-01-26 17:59:18 EST
Eclipse rejects a rename class refactoring. The transformation could be performed with an additional change. 

Steps:

1. Create the classes:

package p1;
public class A {
}

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

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

2. Apply the rename class to rename A to C. Eclipse will show an error: Another type named C is referenced in C.java. Other refactoring tools perform the following behavior-preserving transformation:

package p1;
public class C {
}

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

package p2;
import p1.*;
public class C extends p1.C {
}
Comment 1 Stephan Herrmann CLA 2013-01-27 08:42:33 EST
Moving to JDT/UI
Comment 2 Markus Keller CLA 2013-01-28 08:40:29 EST

*** This bug has been marked as a duplicate of bug 391710 ***
Comment 3 Gustavo Soares CLA 2016-09-23 08:20:49 EDT
(In reply to Markus Keller from comment #2)
> 
> *** This bug has been marked as a duplicate of bug 391710 ***


Why do you consider this bug as duplicate of bug 391710? 
In this bug, Eclipse rejects the transformation and reports the warning message: " Another type named * is referenced in *.", while in the bug 391710 Eclipse rejects the transformation and reports the message: "Name conflict with type *.". 
Therefore, for each transformation (this bug and bug 391710) a different precondition was unsatisfied. In my point of view each bug is related to a different overly strong condition.