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 167246 - NullPointerException when user is changing configuration
Summary: NullPointerException when user is changing configuration
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Thomas Preisler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-17 15:23 UTC by soldatov
Modified: 2009-06-18 06:58 UTC (History)
0 users

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 soldatov 2009-06-17 15:23:32 UTC
Scenario:
- Create Welcome sample
- Delete project
==> 'Projects' tab is empty
- Select 'Release' mode on toolbar
==>
java.lang.NullPointerException
	at
org.netbeans.modules.cnd.makeproject.MakeProjectConfigurationProvider.setActiveConfiguration(MakeProjectConfigurationProvider.java:84)
	at org.netbeans.modules.project.ui.actions.ActiveConfigAction$10.run(ActiveConfigAction.java:499)
	at org.netbeans.modules.project.ui.actions.ActiveConfigAction$10.run(ActiveConfigAction.java:497)
	at org.openide.util.Mutex.writeAccess(Mutex.java:433)
	at org.netbeans.modules.project.ui.actions.ActiveConfigAction.setActiveConfiguration(ActiveConfigAction.java:497)
	at org.netbeans.modules.project.ui.actions.ActiveConfigAction.activeConfigurationSelected(ActiveConfigAction.java:224)
	at org.netbeans.modules.project.ui.actions.ActiveConfigAction.access$600(ActiveConfigAction.java:90)
	at org.netbeans.modules.project.ui.actions.ActiveConfigAction$1.actionPerformed(ActiveConfigAction.java:126)
	at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1240)
	at javax.swing.JComboBox.setSelectedItem(JComboBox.java:567)
	at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:603)
	at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:816)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
	at java.awt.Component.processMouseEvent(Component.java:6263)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:480)
	at java.awt.Component.processEvent(Component.java:6028)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4630)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Window.dispatchEventImpl(Window.java:2475)
	at java.awt.Component.dispatchEvent(Component.java:4460)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 1 Thomas Preisler 2009-06-17 19:27:47 UTC
Fixed the NPE.

The underlying problem is actually a bug in the NB's project system. The bug appears if you delete (or close) the last open project. If you do, NB's project 
system keeps the last open project's configurations in the combo box in the toolbar even the project is no longer around (deleted or closed). It should blank 
out the combobox. Try Java (and probably any other project type) and you will see the same behavior.

I fixed the NPE resulting from operating of the deleted project. I also implemented a work-around in case you delete the project. It will now send a 
notification to the configuration manager so it can blank out the combobox. The same work-around doesn't work when closing the project and the bug 
should be fixed in NB's project system. I will file the bug.
Comment 2 Thomas Preisler 2009-06-17 19:38:54 UTC
IZ filed: http://www.netbeans.org/issues/show_bug.cgi?id=167259
Comment 3 Quality Engineering 2009-06-18 06:58:47 UTC
Integrated into 'main-golden', will be available in build *200906180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e9ab78206657
User: Thomas Preisler <thp@netbeans.org>
Log: #167246 NullPointerException when user is changing configuration