This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Build ID: 200609161800 (Netbeans 6.0 M3) Renaming method m to k should return a warning explaining that another name will shadow access to the renamed element. Steps To Reproduce: Rename method m to k in the following: public class A { private void m(){} class B{ void k(){ m(); } } } Yields the following refactored class: public class A { private void k(){} class B{ void k(){ k(); } } } Note: In these other cases, the refactoring should also return a warning - Rename method m to k class B{ void k(){} } class A extends B{ static public void m(){} } - Rename method m to k package p; import static p.A.m; public class A { public static void m() { } } class B { void use() { m(); } void k() {} }
Note: A similar problem happens when we have interfaces, for example: - renaming method A.m to k yields compilation error in the following case: class B { void k(){ } } class A extends B implements I{ public void m(){ } } interface I{ void m(); } - renaming I.m to k yields compilation error in the following case: interface I{ void m(); } class A{ public void m(){} } class B1 extends A implements I{ } class B2 extends A { public void m(){} public void k(){} }
I just noticed that 3 of the examples in my notes (first, third and fourth) correspond to a different bug and I have created Issue 99596 for them.
Yes. This is valid issue.
*** Bug 249187 has been marked as a duplicate of this bug. ***