Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 246143 - service model configuration can easily become lost
Summary: service model configuration can easily become lost
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: RDT (show other bugs)
Version: 2.1M2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.1   Edit
Assignee: Chris Recoskie CLA
QA Contact: Greg Watson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-03 16:27 EDT by Mike Kucera CLA
Modified: 2009-01-20 15:38 EST (History)
0 users

See Also:


Attachments
proposed patch (1.86 KB, patch)
2008-09-03 16:29 EDT, Mike Kucera CLA
no flags Details | Diff
better patch (3.67 KB, patch)
2008-09-04 11:52 EDT, Mike Kucera CLA
recoskie: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kucera CLA 2008-09-03 16:27:43 EDT
The service model configuration is saved using an IMemento when the workbench is shut down. The problem with this is that if the workbench is terminated abnormally the service model does not get saved. Then when restarting eclipse the configuration is not available, this causes IServiceConfiguration.getServiceProvider() to return null, and I start getting NPEs all over the place.

I think the fix is to save the memento on all workspace saves, including snapshots.

Also code that calls getServiceProvider() should take into account that it may return null.
Comment 1 Mike Kucera CLA 2008-09-03 16:29:42 EDT
Created attachment 111628 [details]
proposed patch
Comment 2 Mike Kucera CLA 2008-09-03 17:08:46 EDT
Actually I'm still having some problems with the configuration not saving. There seems to be an NPE originating from inside saveModelConfiguration() which prevents the memento from being saved. I'm going to dig a bit deeper.
Comment 3 Mike Kucera CLA 2008-09-04 11:52:36 EDT
Created attachment 111679 [details]
better patch
Comment 4 Chris Recoskie CLA 2008-09-04 12:02:07 EDT
Applied to HEAD.  Thanks.