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.
Product Version: NetBeans IDE Dev (Build 200905190001) Java: 1.6.0_14-ea; Java HotSpot(TM) Client VM 14.0-b12 System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb) have somewhere in the code a line -------------------- int a = 0; -------------------- select the line and invoke refactor|introduce method, confirm the dialog (with some name) the resultant code will be like -------------------- int a = foo(); -------------------- and a new method will be in the class -------------------- int foo(){ int a = 0; return a; } -------------------- now select the line 'int a = foo();' and invoke refactor|introduce method. In the dialog insert the same name as before (in this case 'foo') and confirm. No warning is shown, and the code is now like -------------------- int foo(){ int a = 0; return a; } int foo(){ int a = foo(); return a; } ... int a = foo() ... --------------------
the same applies to 'introduce field' - it is possible to create duplicite fields.
It even seems to apply to introducing anything(constants, method, field, variable).
Already filed, thanks anyway. *** This issue has been marked as a duplicate of 106501 ***