Bug 231149 - One more NPE in AbstractCLaunchDelegate
Summary: One more NPE in AbstractCLaunchDelegate
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-cdi (show other bugs)
Version: 4.0.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 5.0   Edit
Assignee: Elena Laskavaia CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-05-08 11:42 EDT by Alex Chapiro CLA
Modified: 2009-01-09 14:00 EST (History)
2 users (show)

See Also:


Attachments
This is a patch (1009 bytes, patch)
2008-05-08 11:42 EDT, Alex Chapiro CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Chapiro CLA 2008-05-08 11:42:10 EDT
Created attachment 99311 [details]
This is a patch

Build ID: 3.4M6

Steps To Reproduce:
1.Create two projects. 
2.Launch debug session from the first one using pull-down menu option Debug As...
3.Then open Launch Configuration dialog
4. Duolicate configuration created for the first project and update it for the second project.
5. Page to debugger tab back and forth or launch it.

You'll get NPE with such trace log:

java.lang.NullPointerException
	at org.eclipse.cdt.launch.AbstractCLaunchDelegate.setBuildConfiguration(AbstractCLaunchDelegate.java:572)
	at org.eclipse.cdt.launch.AbstractCLaunchDelegate.buildForLaunch(AbstractCLaunchDelegate.java:548)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:732)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:614)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:827)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.java:1030)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)



More information:
Actually the cause of this bug is clear: when user duplicates configuration, IDE also copies ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID attribute. However, ICProjectDescription object is nothing to do with launch configuration and of course it doesn't hold proper object ICConfigurationDescription. 
The fixing is obvious: because we do not control duplication process, we just should check if project description finds configuration description. 
I attach this micro-patch to this report.
Comment 1 Elena Laskavaia CLA 2008-05-21 11:23:08 EDT
-> patch applied on head (5.0)
Comment 2 Doug Schaefer CLA 2008-06-03 14:03:24 EDT
repopening to assign.
Comment 3 Doug Schaefer CLA 2008-06-03 14:03:48 EDT
putting back to fixed.