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 121448 - REF: Collision when variable name is changed using more ways
Summary: REF: Collision when variable name is changed using more ways
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2007-11-08 11:07 UTC by Jana Maleckova
Modified: 2009-05-25 20:57 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
message log (94.58 KB, text/plain)
2007-11-08 11:08 UTC, Jana Maleckova
Details
form file (1.50 KB, text/plain)
2007-11-08 11:10 UTC, Jana Maleckova
Details
java file (1.81 KB, text/plain)
2007-11-08 11:11 UTC, Jana Maleckova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jana Maleckova 2007-11-08 11:07:00 UTC
Product Version: NetBeans IDE 6.0 RC1 (Build 200711080000)
Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b03
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)

Description:
============
have j2se project with form class
1. insert jButton and do double click to generate action handler for it
2. select this button and set visible code card instead properties one which is opened as default
3. change variable name of this button using contextual menu invoked on node in inspector
4. switch to source code
5. invoke rename - refactoring on button's variable in source code
6. switch to design to check if all variable occurrences were correctly changed (node in inspec should be changed,
variable name on code card as well)- should be OK
7. switch to source and do refactoring undo
8. switch to design to check if all variable occurrences were correctly changed -  should be OK as well
9. switch to source and do refactoring redo
10. switch to design to check if all variable occurrences were correctly changed - see button's node in inspector is not
updated and doesn't correspond with variable name in source

Then is sufficient to rename variable in source again and from this point, form class is unstable.
Button is not possible to delete because in every case when is selected, an exception is thrown. Log file is enclosed as
attachment.

If form is reopened then button can be deleted from design but it's declaration remains in source code which causes NPE


StackTraces:
============
SEVERE [global]
java.lang.IllegalArgumentException: A node selection cannot contain nodes ([JFrame]) not underneath the root (Form
NewJFrame).
	at org.openide.explorer.ExplorerManager.checkUnderRoot(ExplorerManager.java:555)
	at org.openide.explorer.ExplorerManager.access$300(ExplorerManager.java:89)
	at org.openide.explorer.ExplorerManager$1AtomicSetSelectedNodes.checkArgumentIsValid(ExplorerManager.java:233)
	at org.openide.explorer.ExplorerManager$1AtomicSetSelectedNodes.run(ExplorerManager.java:286)
	at org.openide.util.Mutex.readAccess(Mutex.java:318)


java.lang.NullPointerException
	at org.netbeans.modules.form.FormEditorSupport$JavaEditorTopComponent.componentShowing(FormEditorSupport.java:1202)
	at org.netbeans.core.multiview.MultiViewPeer.peerComponentShowing(MultiViewPeer.java:198)
	at org.netbeans.core.multiview.MultiViewCloneableTopComponent.componentShowing(MultiViewCloneableTopComponent.java:119)
	at org.openide.windows.WindowManager.componentShowing(WindowManager.java:330)
Comment 1 Jana Maleckova 2007-11-08 11:08:23 UTC
Created attachment 52711 [details]
message log
Comment 2 Jana Maleckova 2007-11-08 11:10:47 UTC
Created attachment 52712 [details]
form file
Comment 3 Jana Maleckova 2007-11-08 11:11:05 UTC
Created attachment 52713 [details]
java file
Comment 4 Jan Stola 2007-11-09 14:06:28 UTC
Product Version: NetBeans IDE 6.0 RC1 (Build 200711090000)
Java: 1.5.0_11; Java HotSpot(TM) Client VM 1.5.0_11-b03
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

I am sorry, I am not able to reproduce this issue. I followed the steps twice and everything worked as designed. Are 
you still able to reproduce it?
Comment 5 Jana Maleckova 2007-11-09 15:55:28 UTC
yes I can reproduce it again and on both jdk. But I can say, sometimes I have to the steps 7-9 more then twice. 
Then form reaches the state when rename of variable is not done on all places
Comment 6 Jan Stola 2007-11-09 15:59:51 UTC
The described test case doesn't always lead to the described problem. The test case is also long and artificial => 
lowering priority.