Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335219 - NPE when selecting System configuration in properties view
Summary: NPE when selecting System configuration in properties view
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 0.11   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4   Edit
Assignee: Thomas Wolf CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-24 12:22 EST by Jens Baumgart CLA
Modified: 2016-06-01 10:00 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Baumgart CLA 2011-01-24 12:22:11 EST
Open the properties view for a given repository. Select "System configuration".
NPE occurs.

java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.repository.RepositoryPropertySource.getPropertyDescriptors(RepositoryPropertySource.java:365)
	at org.eclipse.ui.views.properties.PropertySheetEntry.computeMergedPropertyDescriptors(PropertySheetEntry.java:167)
	at org.eclipse.ui.views.properties.PropertySheetEntry.refreshChildEntries(PropertySheetEntry.java:530)
	at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:760)
	at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:973)
	at org.eclipse.ui.views.properties.PropertySheetPage.refresh(PropertySheetPage.java:491)
	at org.eclipse.egit.ui.internal.repository.RepositoryPropertySource$1$1.run(RepositoryPropertySource.java:147)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	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:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	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:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 1 Jens Baumgart CLA 2011-01-24 12:25:37 EST
RepositoryPropertySource Line 101:

systemConfig = SystemReader.getInstance().openSystemConfig(null, FS.DETECTED);

returns a Config object with file==null, if no system config exists. Is this really intended?
Comment 2 Robin Stocker CLA 2013-09-27 12:26:49 EDT
Could not reproduce the problem.
Comment 3 Thomas Wolf CLA 2016-05-30 15:28:34 EDT
The following problem was reported via the automated error reporting:

Message: Unhandled event loop exception
java.lang.NullPointerException: null
    at org.eclipse.egit.ui.internal.repository.RepositoryPropertySource.getPropertyDescriptors(RepositoryPropertySource.java:391)
    at org.eclipse.ui.views.properties.PropertySheetEntry.computeMergedPropertyDescriptors(PropertySheetEntry.java:171)
    at org.eclipse.ui.views.properties.PropertySheetEntry.refreshChildEntries(PropertySheetEntry.java:508)
    at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:735)
    at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:986)
    at org.eclipse.ui.views.properties.PropertySheetPage.refresh(PropertySheetPage.java:500)
    at org.eclipse.egit.ui.internal.repository.RepositoryPropertySource$1$1.run(RepositoryPropertySource.java:206)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)



Bundles:
| org.eclipse.core.runtime | 3.11.1.v20150903-1804 | 3.12.0.v20160506-0702 |
| org.eclipse.e4.core.contexts | 1.4.0.v20150828-0818 | 1.5.0.v20160504-0909 |
| org.eclipse.e4.ui.workbench | 1.3.0.v20150531-1948 | 1.4.0.v20160503-1849 |
| org.eclipse.e4.ui.workbench.renderers.swt | 0.13.0.v20150901-1347 | 0.14.0.v20160429-1232 |
| org.eclipse.e4.ui.workbench.swt | 0.13.0.v20150504-0621 | 0.14.0.v20160411-2100 |
| org.eclipse.egit.ui | 4.0.0.201506090130-r | 4.4.0.201605041135-m1 |
| org.eclipse.jface | 3.11.0.v20150602-1400 | 3.12.0.v20160411-2246 |
| org.eclipse.swt | 3.104.0.v20150528-0211 | 3.105.0.v20160512-0845 |
| org.eclipse.ui | 3.107.0.v20150507-1945 | 3.108.0.v20160505-1310 |
| org.eclipse.ui.navigator | 3.6.0.v20150422-0725 | 3.6.100.v20160505-1330 |
| org.eclipse.ui.views | 3.8.0.v20150422-0725 | 3.8.100.v20160509-1025 |

Operating Systems:
| MacOSX | 10.11.2 | 10.11.3 |
| Windows | 6.1.0 | 10.0.0 |


The above information is a snapshot of the collected data. Visit https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/problems/557ace03e4b0004b455ce757 for the latest data.
Comment 4 Thomas Wolf CLA 2016-05-30 15:36:35 EDT
Select a repository in the repositories view, choose <Context Menu>->Show In->Properties. Then choose the system config.

Several problems here:

1. If the system config does not exist, we get this NPE for exactly the reason Jens identified 5 years ago. Note that on some Macs with Apple git, there is no system config (compare bug 482076), and judging from the AERI reports, there are also Windows configurations where this can occur.

2. If the system config does exist, only the keys are shown, but not the values.

3. If the system config exists but is read-only, the edit button is enabled all the same but bring up a property page dialog in which one cannot edit.
Comment 5 Thomas Wolf CLA 2016-05-30 15:57:17 EDT
(In reply to Thomas Wolf from comment #4)
> 1. If the system config does not exist

Minor correction: if the directory where the system config is supposed to be does not exist, we get this NPE. If the directory exists but not the file, it's fine. Unfortunately, there are indeed configurations where that directory is not present.
Comment 6 Thomas Wolf CLA 2016-05-30 16:04:23 EDT
Once the NPE has occurred, the Properties View becomes dysfunctional and must be closed. Re-opening a new Properties View then works again, until one chooses the system config again.
Comment 7 Eclipse Genie CLA 2016-05-30 16:12:51 EDT
New Gerrit change created: https://git.eclipse.org/r/73983
Comment 8 Eclipse Genie CLA 2016-06-01 10:00:04 EDT
Gerrit change https://git.eclipse.org/r/73983 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=690fc4102c668ebb85b78f1eac2828364f986a1b
Comment 9 Matthias Sohn CLA 2016-06-01 10:00:37 EDT
submitted