| Summary: | [quick fix] Rename renames too much for duplicate local types | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse, milos.gligoric |
| Version: | 3.3 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
Is this rename local (Quick fix) or the rename refactoring? I see the problem. I think it comes from the fact that we connect all similar errors. -> helps in cases like x()= 9; foo(x(), y); (x() not defined) I don't know. I selected the local class and did a rename. Shorter example (based on the original example). (Also note that this example can be compiled.)
public class X {
void m() {
{
// rename "Local" on the next line
class Local {
}
}
class Local {
}
// THIS WILL BE RENAMED TOO
Local l;
}
}
Another example: renaming a method (instead of a class): import java.util.Arrays; import java.util.Comparator; public class Bug167494 { public static void main(String[] args) { Object[] example = new Object[] {}; Arrays.sort(example, new Comparator<Object>() { public int compare(Object o1, Object o2) { return foo(); } // TODO rename "foo" on the next line private int foo() { return 0; } }); Arrays.sort(example, new Comparator<Object>() { public int compare(Object o1, Object o2) { // FOLLOWING "foo" WILL BE RENAMED TOO return foo(); } private int foo() { return 0; } }); } } 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. |
Fup of bug 1665662, try to rename the Local type that contains the constructor. The Local references inside the statement Local l = new Local(); are also renamed. Since the bindings keys are different, this is unexpected. public class X { void foo() { class Local { void foo() { } } { class Local { Local(int i) { this.init(i); this.bar(); // should still resolve } } Local l = new Local(0); // should be fine } Local l = new Local(); l.foo(); } }