Bug 552469 - NPE in Link handlers
Summary: NPE in Link handlers
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.14   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-28 04:44 EDT by Lars Vogel CLA
Modified: 2019-11-03 10:01 EST (History)
4 users (show)

See Also:


Attachments
Screenshot (97.02 KB, image/png)
2019-10-28 04:45 EDT, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-10-28 04:44:42 EDT
In a runtime Eclipse I get the following NPE if I select the Preference page for Link Handlers. 

This error does not occur in my normal IDE.


java.lang.NullPointerException
	at org.eclipse.urischeme.internal.registration.RegistrationLinux.<init>(RegistrationLinux.java:42)
	at org.eclipse.urischeme.IOperatingSystemRegistration.getInstance(IOperatingSystemRegistration.java:39)
	at org.eclipse.ui.internal.ide.application.dialogs.UriSchemeHandlerPreferencePage.init(UriSchemeHandlerPreferencePage.java:107)
	at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(WorkbenchPreferenceNode.java:62)
	at org.eclipse.jface.preference.PreferenceDialog.createPage(PreferenceDialog.java:1280)
	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(FilteredPreferenceDialog.java:338)
	at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1167)
	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:630)
	at org.eclipse.jface.preference.PreferenceDialog$5.lambda$0(PreferenceDialog.java:661)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
	at org.eclipse.jface.preference.PreferenceDialog$5.selectionChanged(PreferenceDialog.java:658)
	at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:818)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:815)
	at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1185)
	at org.eclipse.jface.viewers.StructuredViewer.lambda$0(StructuredViewer.java:1208)
	at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84)
	at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:263)
	at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:258)
	at org.eclipse.jface.util.OpenStrategy$1.lambda$1(OpenStrategy.java:428)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4906)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4428)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
	at org.eclipse.jface.window.Window.open(Window.java:799)
	at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:66)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:579)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:413)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5672)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1423)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4931)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4425)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:660)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Comment 1 Lars Vogel CLA 2019-10-28 04:45:03 EDT
Created attachment 280441 [details]
Screenshot
Comment 2 Michael Keppler CLA 2019-11-02 08:50:05 EDT
Platform.getProduct().getName() throws that NPE, since you are not running a product. I don't use Linux, therefore I cannot say whether the .desktop file really needs that name. If so, the default constructor needs to be changed to handle the null product and to use a fixed value like "Eclipse" in that case.
Comment 3 Marcus Höpfner CLA 2019-11-03 10:01:01 EST
(In reply to Michael Keppler from comment #2)
> Platform.getProduct().getName() throws that NPE, since you are not running a
> product. I don't use Linux, therefore I cannot say whether the .desktop file
> really needs that name. If so, the default constructor needs to be changed
> to handle the null product and to use a fixed value like "Eclipse" in that
> case.

Michael, thanks for the analysis. Would you like to provide a gerrit?