| Summary: | [use supertype] Refactoring adds unwanted package qualification for nested type | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Milos Gligoric <milos.gligoric> | ||||
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | minor | ||||||
| Priority: | P5 | CC: | Jesse.Weinstein, manju656, markus.kell.r | ||||
| Version: | 4.2.1 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
Tried to reproduce the bug using Build ID : I20130115-1300. The refactoring does not result in compiler error. The bug is reproducible using Build ID : I20121009-0800. Looks like this issue is resolved in the latest builds. Milos can you confirm whether you are able to reproduce the bug in the latest builds? Hi Manju,
Thanks for checking the report. In the latest build that I have (20121220-1030) the resulting code is correct. However, note that the package name (usesupertypewherepossible.C2.I1) is not necessary.
public class UseSupertypeWherePossibleBug397157 {
}
class C1 {
// Invoke "Use Supertype Where Possible" on the class below
static class I1<T> extends C2.I1<Object, T> {
}
<T> usesupertypewherepossible.C2.I1<Object, T> m() {
return null;
}
}
class C2 {
static class I1<T1, T2> {
}
}
The originally reported bug is no more valid. Modifying the bug to track the "Use Supertype where possible" refactoring issue which inserts an unwanted package qualification to the refactored code. Complete example for the new bug (unnecessary type parameters removed):
package usesupertypewherepossible;
class C1 {
// Invoke "Use Supertype Where Possible" on the class below
static class I1 extends C2.I1 {
}
I1 m() { // becomes usesupertypewherepossible.C2.I1
return null;
}
}
class C2 {
static class I1 {
}
}
Created attachment 226888 [details]
Minimal project to verify the problem
Verified with eclipse-SDK-N20130210-2000-win32, for what it's worth. Attachment is a minimal project, to facilitate further verification.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Steps to reproduce: 1. See the instructions in code below 2. The resulting code does not compile Build id: 20121114-2344 class C1 { // Invoke "Use Supertype Where Possible" on the class below static class I1<T> extends C2.I1<Object, T> { } <T> I1<T> m() { return null; } } class C2 { static class I1<T1, T2> { } }