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 201053 - Renaming to deleted component does not work
Summary: Renaming to deleted component does not work
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-17 18:59 UTC by misterm
Modified: 2011-09-07 12:35 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description misterm 2011-08-17 18:59:40 UTC
Steps to reproduce:

- Open a form with at least one named component;
- Delete the named component;
- Add another component and invoke Change variable name, with the name of the deleted component

The IDE doesn't allow the renaming operation to complete stating there is a component with said name already.

Workaround: Save form after deleting and before trying the rename operation.

Product Version = NetBeans IDE Dev (Build 20110815-46e7ed429e28)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_19
Runtime = Java HotSpot(TM) Client VM 16.2-b04
Comment 1 Jan Stola 2011-09-07 12:19:20 UTC
This bug is caused by lazy regeneration of the source code of the form. The deleted component is removed from the form model, but the corresponding field remains in the .java file (till the form is saved or till the user switches to Source tab). Unfortunately, the code that performs the renaming also checks the presence of a field in .java file. Hence, it refuses to perform a rename to "already existing" field.
Comment 2 Jan Stola 2011-09-07 12:35:29 UTC
Fixed by forcing code regeneration before rename.

Modified file: http://hg.netbeans.org/jet-main/rev/00a7aebc2336