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 204494 - Deleting of event handlers - last handler with a same name
Summary: Deleting of event handlers - last handler with a same name
Status: RESOLVED INVALID
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.1
Hardware: PC All
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-01 09:45 UTC by asenk
Modified: 2011-11-01 10:40 UTC (History)
1 user (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 asenk 2011-11-01 09:45:59 UTC
Product Version: NetBeans IDE Dev (Build 201110300600)
Java: 1.7.0_01; Java HotSpot(TM) Client VM 21.1-b02
System: Linux version 3.0.0-12-generic-pae running on i386; UTF-8; en_US (nb)
User directory: /home/tester/.netbeans/dev
Cache directory: /home/tester/.netbeans/dev/var/cache

1.Add two JButtons into JFrame
2.Select first JButton
3.Select Properties-> Events Tab
4.Click on Combobox next to the "actionPerformed"
5.Write: "actionH"
NEW EVENT HANDLER IS CREATED

6.Repeat steps 2-5 with second Button

So, now you have two JButtons with the same handler.

7.In Properties-> Events Tab delete this handler for first and the for second JButton

According to this test spec:

#Delete an event handler of a component
#If the event handler is the last handler which is attached to the event then a dialog should be shown
#You can confirm deleting of the event handler ( including user code - assure it ) or let it be  

I expect some warning dialog.
Comment 1 Jan Stola 2011-11-01 10:40:00 UTC
The mentioned warning dialog was removed on June 24th 2002. See http://hg.netbeans.org/jet-main/rev/28c3d5815f25 So, congratulation for being the first one after more than 9 years to go through this test specification!

The current behaviour (with no warning dialog) is as designed. So, it is the test specification that should be fixed.

The possibility to leave the event handler in the code was problematic. It was a piece of code in a guarded block that cannot be removed when it is not attached to any component. Moreover, when the user deletes accidentaly some code that (s)he may need then (s)he can always undo this change.