Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361437 - NPE trying to view preferences
Summary: NPE trying to view preferences
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Kevin Sawicki CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-19 13:01 EDT by Michael Rennie CLA
Modified: 2011-11-07 17:20 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2011-10-19 13:01:55 EDT
Eclipse:
Version: 3.8.0
Build id: I20111018-0850

EGit:
1.1.0.201109151100-r

Steps:
1. try to open the Team > EGit > Configuration preference page

Expected:
to be able to change some settings

Happens:

java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.preferences.GlobalConfigurationPreferencePage$4.compare(GlobalConfigurationPreferencePage.java:255)
	at org.eclipse.egit.ui.internal.preferences.GlobalConfigurationPreferencePage$4.compare(GlobalConfigurationPreferencePage.java:1)
	at java.util.Arrays.mergeSort(Arrays.java:1270)
	at java.util.Arrays.mergeSort(Arrays.java:1282)
	at java.util.Arrays.sort(Arrays.java:1210)
	at java.util.Collections.sort(Collections.java:159)
	at org.eclipse.egit.ui.internal.preferences.GlobalConfigurationPreferencePage.sortRepositoriesByName(GlobalConfigurationPreferencePage.java:251)
	at org.eclipse.egit.ui.internal.preferences.GlobalConfigurationPreferencePage.init(GlobalConfigurationPreferencePage.java:246)
	at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(WorkbenchPreferenceNode.java:57)
	at org.eclipse.jface.preference.PreferenceDialog.createPage(PreferenceDialog.java:1339)
	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(FilteredPreferenceDialog.java:376)
	at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1230)
	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:674)
	at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:708)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:704)
	at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:888)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:886)
	at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1226)
	at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1251)
	at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:262)
	at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:256)
	at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:433)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:215)
	at org.eclipse.ui.internal.handlers.ShowPreferencePageHandler.execute(ShowPreferencePageHandler.java:54)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:352)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1431)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1407)
Comment 1 Michael Rennie CLA 2011-10-19 13:16:53 EDT
The same problem occurs 1.2.0.201110190928
Comment 2 Remy Suen CLA 2011-10-22 21:48:48 EDT
Where are your Git repositories located? Are they all on a local hard disk?
Comment 3 Michael Rennie CLA 2011-10-24 10:23:36 EDT
(In reply to comment #2)
> Where are your Git repositories located? Are they all on a local hard disk?

Yes - C:\Users\mrennie\git
Comment 4 Remy Suen CLA 2011-10-30 20:29:06 EDT
Michael, are you still seeing this problem?

Could you attach your preferences file?
ws/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs file?
Comment 5 Michael Rennie CLA 2011-10-31 14:42:29 EDT
(In reply to comment #4)
> Michael, are you still seeing this problem?
> 
> Could you attach your preferences file?
> ws/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs
> file?

Just looked at my configuration file and there was an entry there like: C:/home/mrennie/org.eclipse.orion.git. I deleted the entry and restarted Eclipse - problem gone.

I don't recall sharing settings from my Windows box to my Linux machine, but that could have been the problem.
Comment 6 Remy Suen CLA 2011-10-31 14:45:01 EDT
(In reply to comment #5)
> Just looked at my configuration file and there was an entry there like:
> C:/home/mrennie/org.eclipse.orion.git. I deleted the entry and restarted
> Eclipse - problem gone.

Thanks. It seems like we should ignore invalid entries in the file then.
Comment 7 Kevin Sawicki CLA 2011-11-07 13:56:00 EST
Proposed fix pushed to: http://egit.eclipse.org/r/4555
Comment 8 Matthias Sohn CLA 2011-11-07 17:20:43 EST
merged as 4d9c4a16e11ae08653ed6df5abd991ed634bc67b