Project: appceleratorstudio
Issue TISTUD-2244: NPE in the log when opening Titanium preferences page on Linux
When the Titanium Studio > Titanium preference page is opened on Linux, the following exception is generated in the log: {code} !ENTRY com.appcelerator.titanium.ui.ide 4 0 2012-09-04 13:01:14.789 !MESSAGE (Build 2.1.2.201208301612) [ERROR] Failed to load BlackBerry device password !STACK 0 java.lang.NullPointerException com.appcelerator.titanium.ui.preferences.TitaniumPreferencePage.initialize(TitaniumPreferencePage.java:153) org.eclipse.jface.preference.FieldEditorPreferencePage.createContents(FieldEditorPreferencePage.java:233) org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:232) org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1501) org.eclipse.jface.preference.PreferenceDialog$14.run(PreferenceDialog.java:1258) org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1252) org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:674) org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:708) org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:704) org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:888) org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:886) org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1726) org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1139) org.eclipse.jface.preference.PreferenceDialog.selectSavedItem(PreferenceDialog.java:1054) org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.selectSavedItem(FilteredPreferenceDialog.java:729) org.eclipse.jface.preference.PreferenceDialog$4.run(PreferenceDialog.java:375) org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) org.eclipse.jface.preference.PreferenceDialog.createContents(PreferenceDialog.java:371) org.eclipse.jface.window.Window.create(Window.java:431) org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089) org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.createDialogOn(WorkbenchPreferenceDialog.java:102) org.eclipse.ui.dialogs.PreferencesUtil.createPreferenceDialogOn(PreferencesUtil.java:192) org.eclipse.ui.dialogs.PreferencesUtil.createPreferenceDialogOn(PreferencesUtil.java:116) com.appcelerator.titanium.ui.ide.tiappEditor.TiAppDeployTargetsSection$2.linkActivated(TiAppDeployTargetsSection.java:278) org.eclipse.ui.forms.widgets.AbstractHyperlink.handleActivate(AbstractHyperlink.java:233) org.eclipse.ui.forms.widgets.AbstractHyperlink.handleMouseUp(AbstractHyperlink.java:327) org.eclipse.ui.forms.widgets.AbstractHyperlink.access$2(AbstractHyperlink.java:311) org.eclipse.ui.forms.widgets.AbstractHyperlink$4.handleEvent(AbstractHyperlink.java:125) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) com.appcelerator.titanium.rcp.IDEApplication.start(IDEApplication.java:125) org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:616) org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) org.eclipse.equinox.launcher.Main.run(Main.java:1410) {code} This is because we are only creating BlackBerry fields on Mac and Windows. Think we should instead always create the fields but then hide them using GridData.exclude according to the OS; that way we don't have to check if a field is null all over the place.
Story points: 5