Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348665

Summary: NullPointerException in Team->Show Blame Annotations
Product: [Technology] EGit Reporter: Bernard Leach <leachbj>
Component: UIAssignee: Kevin Sawicki <kevin>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: pwebster, tomasz.zarna
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Bernard Leach CLA 2011-06-07 20:11:21 EDT
The following exception occured after selecting the Team->Show Blame Annotations in an editor.

!ENTRY org.eclipse.ui 4 0 2011-06-08 10:00:29.667
!MESSAGE Unhandled event loop exception
!STACK 0
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:3515)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3164)
        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.blame.BlameRevision.getDate(BlameRevision.java:47)
        at org.eclipse.jface.internal.text.revisions.RevisionPainter$ColorTool.computeAge(RevisionPainter.java:240)
        at org.eclipse.jface.internal.text.revisions.RevisionPainter$ColorTool.setInfo(RevisionPainter.java:166)
        at org.eclipse.jface.internal.text.revisions.RevisionPainter.paint(RevisionPainter.java:722)
        at org.eclipse.jface.text.source.LineNumberChangeRulerColumn.doPaint(LineNumberChangeRulerColumn.java:188)
        at org.eclipse.jface.text.source.LineNumberRulerColumn.doubleBufferPaint(LineNumberRulerColumn.java:703)
        at org.eclipse.jface.text.source.LineNumberRulerColumn.redraw(LineNumberRulerColumn.java:859)
        at org.eclipse.jface.text.source.LineNumberRulerColumn$1.run(LineNumberRulerColumn.java:422)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
        ... 22 more
Comment 1 Kevin Sawicki CLA 2011-06-07 20:27:51 EDT
Fix pushed to: http://egit.eclipse.org/r/#change,3681
Comment 2 Kevin Sawicki CLA 2011-06-07 20:57:16 EDT
Did then commit you ran into this issue on not have an author line?
Comment 3 Bernard Leach CLA 2011-06-07 21:58:46 EDT
The file in question was last updated in a merge commit a week ago.  It looks like it has an Author line on each commit.
Comment 4 Bernard Leach CLA 2011-06-07 22:52:25 EDT
This bug is more problematic than I had originally thought.  It keeps occurring on the drawing thread which leaves the eclipse workspace half-drawn and leaves the UI unusable (it doesn't respond the UI inputs).
Comment 5 Kevin Sawicki CLA 2011-06-07 23:36:52 EDT
Can you try the current patch at: http://egit.eclipse.org/r/#change,3681 and see if it resolves the issue for you?
Comment 6 Bernard Leach CLA 2011-06-08 00:12:14 EDT
With that patch the NPE issue is resolved however the file is only partially annotated.  There are blocks that have no annotations.  These blocks are sections that haven't been modified since the initial revision of the file, cgit blame shows them as ^shaid instead of just shaid.
Comment 7 Bernard Leach CLA 2011-06-08 03:12:06 EDT
On further investigation I found that the RevCommit (e.g. BlameResult.getSourceCommit()) for lines that had not changed since the initial commit is null.  That seems to be an issue with the jgit blame generator (or perhaps the client is supposed to then work out what the initial commit for the file was).
Comment 8 Kevin Sawicki CLA 2011-06-08 13:16:37 EDT
Is the file you are seeing this issue on in a public repository?  If not, can you describe the history a bit, such as 5 revisions, 2 merges, etc.,  I'd like to reproduce this locally.
Comment 9 Kevin Sawicki CLA 2011-06-08 15:42:23 EDT
Merged in: http://egit.eclipse.org/r/#change,3688
Comment 10 Kevin Sawicki CLA 2011-06-09 12:13:06 EDT
*** Bug 348886 has been marked as a duplicate of this bug. ***
Comment 11 Tomasz Zarna CLA 2011-06-10 05:56:26 EDT
Verified in EGit 1.1.0.201106100458, thanks Kev.