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

Bug 328284

Summary: [Preferences] AbstractEncodingFieldEditor used in conjunction with FieldEditorPreferencePage throws a NPE during dispose.
Product: [Eclipse Project] Platform Reporter: Pascal Gélinas <pascal.gelinas>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 3.6.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Pascal Gélinas CLA 2010-10-20 15:31:00 EDT
The title speaks for itself... here's a stack trace to pinpoint the problem. I think wrapping the logic found there in a null check would fix the issue, or moving it to doLoadDefault() might be even better.

java.lang.NullPointerException
        at org.eclipse.ui.ide.dialogs.AbstractEncodingFieldEditor.setPreferenceStore(AbstractEncodingFieldEditor.java:197)
        at org.eclipse.jface.preference.FieldEditorPreferencePage.dispose(FieldEditorPreferencePage.java:269)
        at org.eclipse.jface.preference.PreferenceNode.disposeResources(PreferenceNode.java:173)
        at org.eclipse.ui.internal.preferences.WorkbenchPreferenceExtensionNode.disposeResources(WorkbenchPreferenceExtensionNode.java:138)
        at org.eclipse.jface.preference.PreferenceDialog$2.run(PreferenceDialog.java:301)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.jface.preference.PreferenceDialog.close(PreferenceDialog.java:315)
        at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.close(FilteredPreferenceDialog.java:696)
        at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.close(WorkbenchPreferenceDialog.java:145)
        at org.eclipse.jface.preference.PreferenceDialog.cancelPressed(PreferenceDialog.java:274)
        at org.eclipse.jface.preference.PreferenceDialog.buttonPressed(PreferenceDialog.java:237)
        ........snip........
Comment 1 Remy Suen CLA 2010-10-22 10:43:19 EDT
(In reply to comment #0)
> I
> think wrapping the logic found there in a null check would fix the issue, or
> moving it to doLoadDefault() might be even better.

A null check is definitely required since the API is spec'd to allow null as a valid argument to the method.
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:07:19 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 3 Eclipse Genie CLA 2022-01-21 05:45:26 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.