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 198387 - NullPointerException if "New C Simple Test" is created
Summary: NullPointerException if "New C Simple Test" is created
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.0.1
Hardware: PC Solaris
: P2 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-06 13:44 UTC by soldatov
Modified: 2011-05-25 11:06 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 2011-05-06 13:44:30 UTC
Scenario:
- Create empty C/C++ Application
- Add some folder with c/c++ files via "Add Existing Items from Folder" wizard
- Call "New C Simple Test ..." wizard
- Create new test
==>
java.lang.NullPointerException
	at org.netbeans.modules.cnd.makeproject.actions.NewTestActionFactory$NewTestAction.actionPerformed(NewTestActionFactory.java:157)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
	at java.awt.Component.processMouseEvent(Component.java:6267)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6032)
	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:4577)
	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:2478)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
[catch] 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 Vladimir Kvashin 2011-05-07 13:04:26 UTC
I thought that this was introduces by recent project system changes, but that's not true. The 6.9.1 behaves the same way.

When user adds files from folders, another source root (external one) is added to the project. If user selects this external source root when creating the test, the newly added file is not added to the project. This leads to the NPE. If we avoid NPE via null check, the file anyhow won't be added to tests - new test folder will be empty.
Comment 2 Vladimir Kvashin 2011-05-24 15:54:19 UTC
http://hg.netbeans.org/releases/rev/df70d1579068
Comment 3 Quality Engineering 2011-05-25 11:06:24 UTC
Integrated into 'main-golden', will be available in build *201105250400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/daf22cb67543
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixed #198387 - NPE in "New C Simple Test"
(transplanted from df70d1579068c1b021d49c68ba3f0046523cf3b9)