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.
If you rename a field that is used within a UI-generated method (e.g., an actionPerformed method of a UI widget), netbeans fails to rename the usage within that method. If you select Preview, you will see an error message: Error: This occurrence is in a read-only block of text and cannot be refactored The attached project will illustrate this. Select the instance variable "var" and use "Refactor-->Rename" to rename it to something else, like "var2".
Created attachment 42475 [details] Test project demonstrating the bug
I forgot to mention that I'm running 6.0m9
This is known bug. I hope it will be fixed in M10. Thanks for your report. *** This issue has been marked as a duplicate of 48288 ***
I read the bug report for issue 48288, the bug that you closed this issue as a duplicate of, and I'm not convinced that it is the same issue. I guess the fix for 48288 could fix my issue, but I'm not certain that it will. Issue 48288 talks about a long-standing issue with renaming variables that appear in a form file. My problem is a bug that was introduced in NB 6.0 (it works fine in NB5.5) related to variables that appear in the program itself, having nothing to do with the .form file. The variable is within an IDE-generated method, but is *not* in the part generated by the IDE, but is within the body of the method, which is user code. Having said that, I'll test with m10 when it comes out.