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

Bug 361085

Summary: java.lang.NullPointerException at org.eclipse.egit.ui.internal.CompareUtils.compareHeadWithWorkspace(CompareUtils.java:349)
Product: [Technology] EGit Reporter: Michael Vorburger <mike>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.sohn, remy.suen
Version: 1.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Vorburger CLA 2011-10-16 09:16:20 EDT
Using 1.1.0.201109151100-r, I had a pom.xml with a wrong <parent><relativePath>../pom.xml</relativePath> which I corrected, and upon double-clicking to do a compare of the pom.xml in the Files list in the Commit Changes dialog, the NPE below occurred. (Not sure if this is related, just trying to describe)



-- Error Details --
Date: Sun Oct 16 15:11:13 CEST 2011
Message: Unhandled event loop exception
Severity: Error
Product: Eclipse 1.4.0.20110609-1120 (org.eclipse.epp.package.java.product)
Plugin: org.eclipse.ui
Session Data:
eclipse.buildId=I20110613-1736
java.version=1.6.0_22
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product

Exception Stack Trace:
java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.CompareUtils.compareHeadWithWorkspace(CompareUtils.java:349)
	at org.eclipse.egit.ui.internal.dialogs.CommitDialog$CommitItemSelectionListener.widgetDefaultSelected(CommitDialog.java:258)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:119)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	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.commit.CommitUI.commit(CommitUI.java:183)
	at org.eclipse.egit.ui.internal.actions.CommitActionHandler.execute(CommitActionHandler.java:49)
	at org.eclipse.egit.ui.internal.actions.RepositoryAction.run(RepositoryAction.java:86)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	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:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	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(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	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)
Comment 1 Remy Suen CLA 2011-10-17 09:22:48 EDT
(In reply to comment #0)
> Using 1.1.0.201109151100-r, I had a pom.xml with a wrong
> <parent><relativePath>../pom.xml</relativePath> which I corrected, and upon
> double-clicking to do a compare of the pom.xml in the Files list in the Commit
> Changes dialog, the NPE below occurred.

Where did you perform this double-click action? It seems you performed it from the commit dialog, is this correct?

Where is the pom.xml relative to the .git folder?
Comment 2 Michael Vorburger CLA 2011-10-17 11:17:46 EDT
> Where did you perform this double-click action? It seems you
> performed it from the commit dialog, is this correct?

Yes indeed.

> Where is the pom.xml relative to the .git folder?

This pom.xml I had changed and edited here was in a sub-folder, imagine a layout like:

   .git/
   module1/pom.xml

Thanks for looking into this!
Comment 3 Remy Suen CLA 2011-10-17 17:41:58 EDT
(In reply to comment #2)
>    module1/pom.xml

Was your module1 project closed in Eclipse?
Comment 4 Michael Vorburger CLA 2011-10-18 08:11:07 EDT
> Was your module1 project closed in Eclipse?

I don't recall... could be (I do close Eclipse projects / Maven modules), but not 100% sure.
Comment 5 Remy Suen CLA 2011-10-22 13:14:12 EDT
Thanks for your bug report, Michael.

I have pushed a change set to Gerrit for review by the other EGit developers.
http://egit.eclipse.org/r/#change,4390

1. Make a file in a project that's controlled by Git dirty.
2. Close that project.
3. Start a commit operation from another project that's in the same Git repository as the project in 1 and 2.
4. Try to double-click on the dirty file from 1, the NPE described by comment 0 will be thrown.
Comment 6 Matthias Sohn CLA 2011-10-22 19:12:40 EDT
merged as 37cf040e06836a3ee9e13918789e7fb56bc6ffdb