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 108676 - ACTIONS: NPE when exitMenuItem has set null action
Summary: ACTIONS: NPE when exitMenuItem has set null action
Status: RESOLVED WONTFIX
Alias: None
Product: guibuilder
Classification: Unclassified
Component: App Framework (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
: 112990 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-02 17:13 UTC by Jana Maleckova
Modified: 2011-11-03 19:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
108676 (1.04 KB, text/plain)
2007-07-02 17:14 UTC, Jana Maleckova
Details
stacktrace 2 (4.55 KB, text/plain)
2007-07-02 17:17 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-07-02 17:13:41 UTC
Product Version: NetBeans IDE Dev (Build 200707012149) Java: 1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)

Description:
============
1. create new JDA project
2. select exitMenuItem in design
3. set is action property as null
4. click somewhere in mainPanel in design => NPE will occur

StackTrace:
===========
java.lang.NullPointerException
	at org.netbeans.modules.form.menu.MenuEditLayer.rebuildOnScreenMenu(MenuEditLayer.java:1014)
	at org.netbeans.modules.form.menu.MenuEditLayer.access$600(MenuEditLayer.java:74)
	at org.netbeans.modules.form.menu.MenuEditLayer$6.formChanged(MenuEditLayer.java:964)
Comment 1 Jana Maleckova 2007-07-02 17:14:13 UTC
Created attachment 44631 [details]
108676
Comment 2 Jana Maleckova 2007-07-02 17:16:47 UTC
when user tries to delete project set like this, another NPE is thrown

StackTrace:
===========
java.lang.NullPointerException
	at org.netbeans.modules.form.menu.MenuEditLayer.unconfigureFormListeners(MenuEditLayer.java:349)
	at org.netbeans.modules.form.menu.MenuEditLayer.hideMenuLayer(MenuEditLayer.java:268)
	at org.netbeans.modules.form.menu.MenuEditLayer$3.formChanged(MenuEditLayer.java:331)
	at org.netbeans.modules.form.FormModel.fireEvents(FormModel.java:988)
Comment 3 Jana Maleckova 2007-07-02 17:17:19 UTC
Created attachment 44632 [details]
stacktrace 2
Comment 4 Joshua Marinacci 2007-08-02 21:02:30 UTC
I cannot reproduce this error. Since the bug was reported several bugs were fixed in this part of the MenuEditLayer, so I think it may already be fixed. Please 
reopen this bug if you can still reproduce it.
Comment 5 Jana Maleckova 2007-08-21 15:30:17 UTC
the first scenario always invoke exception, just do it step by step and exception is thrown

Product Version: NetBeans IDE Dev (Build 070821) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05 System: Windows
XP version 5.1 running on x86; Cp1252; en_GB (nb)
Comment 6 Joshua Marinacci 2007-08-23 19:18:05 UTC
This NPE is fixed now.
Comment 7 Jana Maleckova 2007-08-28 09:48:54 UTC
NPE is really fixed now but the behavior is quite different

e.g. select aboutMenuItem and set null action => item is immediately cleared
when the same is done on exitMenuItem, all attributes of quit action remains on item. User has to set focus somewhere in
design to have exitMenuItem updated.

I think it should be fixed as well
Comment 8 Joshua Marinacci 2007-09-13 02:20:10 UTC
I cannot reproduce this. Can you still reproduce this? Can you tell me the exact operating system and Java version you are using?
Comment 9 Joshua Marinacci 2007-09-13 22:13:55 UTC
I still cannot reproduce this, but I have fixed another bug that makes the exit action be updated when changing action settings, so hopefully that will fix this 
bug.
Comment 10 Jana Maleckova 2007-09-20 19:35:47 UTC
no the issue always remains

version:
Product Version: NetBeans IDE Dev (Build 20070920044928) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05 System:
Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
Comment 11 Joshua Marinacci 2007-09-21 22:50:45 UTC
I can reproduce this on Windows, but not on the Mac. It must be specific to the Windows Look and Feel.
Comment 12 Joshua Marinacci 2007-09-25 00:56:06 UTC
This bug actually affects any global action, not just the 'exit' action.

The root cause of this bug is that we are adding the text "(global)" after any action that is global in the combobox of
the property sheet.  If you have a global action selected the value of the actual current action doesn't match any of
the actions in the current tags (the array of strings returned by getTags()). On Windows this causes the first item in
the combo box to be auto-selected. If the user then selects the first item there will never be a 'change event' fired
for the combobox, so the ActionEditor is never notified that the user selected anything, so the component bound to the
action is never updated.  Since the 'exit' action is always the first in the combobox, it is the only action which ever
exhibits this behavior.

There is no way to fix this without either dropping the "(global)" string or completely hacking the property sheet to
handle cases like this. 

Since this is such a minor bug (the action will still refresh when you focus to another component) I'm moving it off to
'future' and setting the priority to 4.
Comment 13 Quality Engineering 2009-12-21 06:00:58 UTC
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. 

We apologize for any inconvenience.


Thank you.
The NetBeans Team
Comment 14 Marian Mirilovic 2011-11-03 19:37:26 UTC
*** Bug 112990 has been marked as a duplicate of this bug. ***