Bug 52582 [RCP] NPE upon shutdown
Build: I-20040219 Got this NPE upon shutdown. Error Feb 19, 2004 22:29:48.275 Error while stopping plug- in "reference:file:d:/Eclipse/eclipse/plugins/org.eclipse.jdt.ui_3.0.0 [34]". org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.stop() at org.eclipse.osgi.framework.internal.core.BundleContext.stop (BundleContext.java:1155) at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker (BundleHost.java:481) at org.eclipse.osgi.framework.internal.core.Bundle.stop(Bundle.java:477) at org.eclipse.core.internal.plugins.PluginStopper.run(PluginStopper.java:101) at org.eclipse.core.internal.runtime.PlatformActivator.stopLegacyBundles (PlatformActivator.java:286) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:268) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Main.java:279) at org.eclipse.core.launcher.Main.run(Main.java:742) at org.eclipse.core.launcher.Main.main(Main.java:581) Nested exception: java.lang.NullPointerException at org.eclipse.jface.dialogs.DialogSettings.save(DialogSettings.java:377) at org.eclipse.jface.dialogs.DialogSettings.save(DialogSettings.java:326) at org.eclipse.jface.dialogs.DialogSettings.save(DialogSettings.java:351) at org.eclipse.ui.plugin.AbstractUIPlugin.saveDialogSettings (AbstractUIPlugin.java:795) at org.eclipse.ui.plugin.AbstractUIPlugin.shutdown(AbstractUIPlugin.java:834) at org.eclipse.jdt.internal.ui.JavaPlugin.shutdown(JavaPlugin.java:290) at org.eclipse.core.internal.compatibility.PluginActivator.stop (PluginActivator.java:66) at org.eclipse.osgi.framework.internal.core.BundleContext$2.run (BundleContext.java:1139) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContext.stop (BundleContext.java:1114) at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker (BundleHost.java:481) at org.eclipse.osgi.framework.internal.core.Bundle.stop(Bundle.java:477) at org.eclipse.core.internal.plugins.PluginStopper.run(PluginStopper.java:101) at org.eclipse.core.internal.runtime.PlatformActivator.stopLegacyBundles (PlatformActivator.java:286) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:268) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Main.java:279) at org.eclipse.core.launcher.Main.run(Main.java:742) at org.eclipse.core.launcher.Main.main(Main.java:581)
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogSettings.java
public void load(Reader r) {
	Document document = null;
	try {
		DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
		document = parser.parse(new InputSource(r));
		
		
		Node root = document.getFirstChild();
		while(root.getNodeType() == Node.COMMENT_NODE){
			document.removeChild(root);
			root = document.getFirstChild();
		}
		load(document, (Element) root);
	} catch (ParserConfigurationException e) {
	} catch (IOException e) {
	} catch (SAXException e) {
	}
}
/* (non-Javadoc)
 * Method declared on IDialogSettings.
 */
public void load(String fileName) throws IOException {
	FileInputStream stream = new FileInputStream(fileName);
	BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "utf-8"));
	load(reader);
	reader.close();
}
/* (non-Javadoc)
 * Load the setting from the <code>document</code>
 */