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

Bug 339528

Summary: NPE attempting to reset after a merge commit in PlotCommit.getRefCount
Product: [Technology] EGit Reporter: James Blackburn <jamesblackburn+eclipse>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jgit.core-inbox, robin
Version: 0.12   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description James Blackburn CLA 2011-03-10 09:36:35 EST
Using current nightly:
  Eclipse EGit (Incubation)	0.12.0.201103040937	org.eclipse.egit.feature.group
  Eclipse JGit (Incubation)	0.12.0.201103040915	org.eclipse.jgit.feature.group

I got this NPE trying to reset, in the History view to a commit before a merge:

java.lang.NullPointerException
	at org.eclipse.jgit.revplot.PlotCommit.getRefCount(PlotCommit.java:156)
	at org.eclipse.egit.ui.internal.history.CommitGraphTable$4.mouseHover(CommitGraphTable.java:198)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:201)



Immediately after this I got this exception from the Reset handler:

Failed to execute item org.eclipse.egit.ui.history.Reset
org.eclipse.core.commands.ExecutionException: Could not get the current input from the history view
	at org.eclipse.egit.ui.internal.history.command.AbstractHistoryCommanndHandler.getInput(AbstractHistoryCommanndHandler.java:62)
	at org.eclipse.egit.ui.internal.history.command.AbstractHistoryCommanndHandler.getRepository(AbstractHistoryCommanndHandler.java:76)
	at org.eclipse.egit.ui.internal.history.command.ResetHandler.execute(ResetHandler.java:28)
	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)
Comment 1 James Blackburn CLA 2011-03-11 10:53:51 EST
I keep getting these.  Adding jgit core inbox as the NPE is actually in jgit. It's not clear to me whether the UI is at fault or jgit core.
Comment 2 Robin Stocker CLA 2013-09-27 14:02:58 EDT
This was fixed in JGit commit 9953e2a39e3604324103d7dc35615e3f721da36d.