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.

Bug 104088 - Rename field fails to update usage within UI-generated method
Summary: Rename field fails to update usage within UI-generated method
Status: RESOLVED DUPLICATE of bug 48288
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-16 16:52 UTC by kcr
Modified: 2007-05-17 23:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test project demonstrating the bug (9.97 KB, application/octet-stream)
2007-05-16 16:55 UTC, kcr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kcr 2007-05-16 16:52:27 UTC
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".
Comment 1 kcr 2007-05-16 16:55:38 UTC
Created attachment 42475 [details]
Test project demonstrating the bug
Comment 2 kcr 2007-05-16 17:01:34 UTC
I forgot to mention that I'm running 6.0m9
Comment 3 Jiri Prox 2007-05-17 10:25:45 UTC
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 ***
Comment 4 kcr 2007-05-17 23:31:10 UTC
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.