Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354874

Summary: persistence manager hits a NPE during shutdown
Product: [Tools] Target Management Reporter: David McKnight <dmcknigh>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: ddykstal.eclipse, xuanchen
Version: 3.2Flags: xuanchen: review+
ddykstal.eclipse: review+
Target Milestone: 3.3.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 354876    
Attachments:
Description Flags
patch to not set plugin to null none

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.