Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340831 - NPE in history view
Summary: NPE in history view
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 0.12   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Philipp Thun CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-24 03:14 EDT by Robin Rosenberg CLA
Modified: 2011-05-26 04:32 EDT (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 Robin Rosenberg CLA 2011-03-24 03:14:55 EDT
This is new since 0.11.1

1. Select a file and drag it to the history view (presumably Show in history has the same effect).
2. Click the Show All Resouces in Repository icon in the histoy view toolbar
3. Check the error log 

So far I know the commit list contains unexpected null entries.

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3593)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3286)
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(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:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Caused by: java.lang.NullPointerException
at org.eclipse.egit.ui.internal.history.CommitGraphTable.initCommitsMap(CommitGraphTable.java:383)
at org.eclipse.egit.ui.internal.history.CommitGraphTable.setInput(CommitGraphTable.java:367)
at org.eclipse.egit.ui.internal.history.GitHistoryPage$9.run(GitHistoryPage.java:1160)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
... 22 more
Comment 1 Philipp Thun CLA 2011-03-31 13:49:53 EDT
Today I got the same exception when doing the following:

- Opened several projects belonging to different repositories
- Activated the "Link with Editor and Selection" option in History view
- Clicked very fast on different resources (e.g. projects) in Project Explorer

I've tried to debug this issue and it seems to be caused by memory inconsistencies.

Thus I've prepared a patch (http://egit.eclipse.org/r/2985) that synchronizes access to the list of commits. This seems to fix the issue.
Comment 2 Philipp Thun CLA 2011-05-26 04:32:49 EDT
Fixed with change I72a0e842876332fb602319bc03fcd3cd6a2cffe6.