Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354874 - persistence manager hits a NPE during shutdown
Summary: persistence manager hits a NPE during shutdown
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 354876
  Show dependency tree
 
Reported: 2011-08-16 14:14 EDT by David McKnight CLA
Modified: 2011-08-17 10:08 EDT (History)
2 users (show)

See Also:
xuanchen: review+
ddykstal.eclipse: review+


Attachments
patch to not set plugin to null (1.15 KB, patch)
2011-08-16 14:20 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David McKnight CLA 2011-08-16 14:14:20 EDT
The following exception can occur during shutdown:

java.lang.NullPointerException
	at org.eclipse.rse.internal.persistence.PropertyFileProvider.getProfilesFolder(PropertyFileProvider.java:281)
	at org.eclipse.rse.internal.persistence.PropertyFileProvider.getAnchor(PropertyFileProvider.java:267)
	at org.eclipse.rse.internal.persistence.PropertyFileProvider.saveRSEDOM(PropertyFileProvider.java:125)
	at org.eclipse.rse.internal.persistence.PFFileSystemJob.run(PFFileSystemJob.java:66)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


The NPE occurs because the plugin variable in RSECorePlugin is null.  It gets set to null in the RSECorePlugin.stop(BundleContext) call:

        public void stop(BundleContext context) throws Exception {
		LoggerFactory.freeLogger(this);
		logger = null;
		plugin = null;
		super.stop(context);
	}

Since plugin is this, I don't think there's any need to set plugin to null.
Comment 1 David McKnight CLA 2011-08-16 14:20:01 EDT
Created attachment 201598 [details]
patch to not set plugin to null
Comment 2 David McKnight CLA 2011-08-16 14:28:37 EDT
Xuan and Dave D, could you please review this patch?
Comment 3 Xuan Chen CLA 2011-08-16 16:56:56 EDT
The fix looks good.  Thanks.
Comment 4 David McKnight CLA 2011-08-17 10:08:20 EDT
Thanks for the reviews.  I've committed the change to the HEAD stream.