Bug 89487 NPE in PropertyAndPreferencePage.updateLinkVisibility
Got the following NPE while testing pre-project preferences java.lang.NullPointerException at org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage.updateLinkVisibility(PropertyAndPreferencePage.java:245) at org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage.doProjectWorkspaceStateChanged(PropertyAndPreferencePage.java:239) at org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage.access$0(PropertyAndPreferencePage.java:237) at org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage$1.dialogFieldChanged(PropertyAndPreferencePage.java:112) at org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField.dialogFieldChanged(DialogField.java:70) at org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField.changeValue(SelectionButtonDialogField.java:151) at org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField.setSelection(SelectionButtonDialogField.java:170) at org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage.createContents(PropertyAndPreferencePage.java:160) at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:423) at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:388) at org.eclipse.jdt.internal.ui.preferences.CompliancePreferencePage.createControl(CompliancePreferencePage.java:49) at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1407) at org.eclipse.jface.preference.PreferenceDialog$13.run(PreferenceDialog.java:1119) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1021) at org.eclipse.core.runtime.Platform.run(Platform.java:757) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:40) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1113) at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:618) at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:680) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1021) at org.eclipse.core.runtime.Platform.run(Platform.java:757) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:40) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:678) at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:949) at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:969) at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:231) at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:226) at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:392) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:118) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2871) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2530) at org.eclipse.jface.window.Window.runEventLoop(Window.java:803) at org.eclipse.jface.window.Window.open(Window.java:781) at org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage.openProjectProperties(PropertyAndPreferencePage.java:233) at org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage.doLinkActivated(PropertyAndPreferencePage.java:220) at org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage$2.linkActivated(PropertyAndPreferencePage.java:175) at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleActivate(AbstractHyperlink.java:183) at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleMouseUp(AbstractHyperlink.java:265) at org.eclipse.ui.forms.widgets.AbstractHyperlink.access$1(AbstractHyperlink.java:249) at org.eclipse.ui.forms.widgets.AbstractHyperlink$4.handleEvent(AbstractHyperlink.java:95) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2894) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2527) at org.eclipse.jface.window.Window.runEventLoop(Window.java:803) at org.eclipse.jface.window.Window.open(Window.java:781) at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:66) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2894) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2527) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:338) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:151) 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.invokeFramework(Main.java:268) at org.eclipse.core.launcher.Main.basicRun(Main.java:260) at org.eclipse.core.launcher.Main.run(Main.java:887) at org.eclipse.core.launcher.Main.main(Main.java:871) Steps to reproduce: - create project with compiler specific project settings - open the workspace settings - go to page building - click link to project specific settings - on the dialog showing project specific setting click the node Compiler. In addition to the log entry you get a dialog saying that the currently displayed page contains invalid values.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/PropertyAndPreferencePage.java
private Object fData; 
	
	private static final String NO_LINK_DATA= "nolink"; 
	
	public PropertyAndPreferencePage() {
		fBlockStatus= new StatusInfo();
		fBlockEnableState= null;
		fProject= null;
		fData= null;
	}
	protected abstract Control createPreferenceContent(Composite composite);
	protected abstract boolean hasProjectSpecificOptions(IProject project);
	
	protected abstract String getPreferencePageID();
	protected abstract String getPropertyPageID();
	
	protected boolean supportsProjectSpecificOptions() {
		return getPropertyPageID() != null;
	}
	
	protected boolean offerLink() {
		if (fData instanceof String) {
			String str= (String) fData;
			return str.indexOf(NO_LINK_DATA) == -1;
		}
		return true;
	}
	
    protected Label createDescriptionLabel(Composite parent) {
		fParentComposite= parent;