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

Bug 355732

Summary: NPE trying to create patch
Product: [Technology] EGit Reporter: Michael Rennie <Michael_Rennie>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: b.muskalla, Olivier_Thomann, remy.suen, robin.rosenberg, robin
Version: unspecified   
Target Milestone: 3.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael Rennie CLA 2011-08-24 11:52:44 EDT
After doing a local commit and trying to create a patch from the history view I get the following when I press the 'Finish' button in the patch creation wizard:

java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1029)
	at org.eclipse.egit.ui.internal.history.GitCreatePatchWizard.performFinish(GitCreatePatchWizard.java:141)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
	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:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.egit.ui.internal.history.GitCreatePatchWizard.run(GitCreatePatchWizard.java:101)
	at org.eclipse.egit.ui.internal.history.command.CreatePatchHandler.execute(CreatePatchHandler.java:34)
	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.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	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:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	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:344)
	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:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.history.FileDiff.getProjectRelativePath(FileDiff.java:222)
	at org.eclipse.egit.ui.internal.history.FileDiff.outputEclipseDiff(FileDiff.java:175)
	at org.eclipse.egit.ui.internal.history.FileDiff.outputDiff(FileDiff.java:162)
	at org.eclipse.egit.ui.internal.history.GitCreatePatchWizard$1.run(GitCreatePatchWizard.java:169)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 1 Benjamin Muskalla CLA 2011-08-24 11:54:08 EDT
You may want to test this with EGit nightly as we reworked the patch creation.
Comment 2 Remy Suen CLA 2011-08-24 13:03:17 EDT
Probably a duplicate of bug 343276?
Comment 3 Remy Suen CLA 2011-08-24 19:11:40 EDT
Michael, did your commit include changes in files that are not in your Eclipse workspace (or alternatively is in a _closed_ project)?

Also, where did you get EGit? I'm guessing you instaled it from the Indigo site?
Comment 4 Michael Rennie CLA 2011-08-25 10:13:35 EDT
(In reply to comment #3)
> Michael, did your commit include changes in files that are not in your Eclipse
> workspace (or alternatively is in a _closed_ project)?
> 

No, the only projects in my workspace were from the pde.ui git repo, all open.

> Also, where did you get EGit? I'm guessing you instaled it from the Indigo
> site?

Correct.
Comment 5 Robin Rosenberg CLA 2013-04-17 19:29:33 EDT
Still an issue?
Comment 6 Michael Rennie CLA 2013-04-18 14:41:51 EDT
(In reply to comment #5)
> Still an issue?

I have not seen this again since reporting it. So if you think it is fixed, then close it.
Comment 7 Robin Stocker CLA 2013-04-18 16:01:35 EDT
An NPE there was fixed in the nightly: http://git.eclipse.org/c/egit/egit.git/commit/?id=3535a3e37bca6fee8f69c4d4592d7895f6d08db7

Maybe this was the problem. Let's close this, please reopen if you encounter it again.