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.
Creating field with name which is already used in the current scope (variable or parameter in current method) produces not compilable code. But adding "this." would solve the problem Example: 1) have a code: public void test() { final String temp = ""; int c = 1; } 2) select "1" and call introduce field 3) type "temp" as a name of the new field and confirm -> IDE generates: private int temp; public void test() { final String temp = ""; temp = 1; // <- incompatible types int c = temp; //<- incompatible types } but the IDE can generate following code which is ok private int temp; public void test() { final String temp = ""; this.temp = 1; int c = this.temp; } Product Version: NetBeans IDE Dev (Build 20130606-5a346fc7541c) Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b31 Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b89 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb) User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
*** This bug has been marked as a duplicate of bug 205081 ***