Bug 571032 - NPE in diff outline if no changes and compact tree view is chosen
Summary: NPE in diff outline if no changes and compact tree view is chosen
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 5.10   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 5.11   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-08 13:35 EST by Thomas Wolf CLA
Modified: 2021-02-09 16:32 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wolf CLA 2021-02-08 13:35:32 EST
When a unified diff with no changes is shown, the outline view is empty. If compact tree view is chosen, and NPE occurs:

java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.commit.DiffEditorOutlinePage$DiffContentProvider.compactify(DiffEditorOutlinePage.java:583)
	at org.eclipse.egit.ui.internal.commit.DiffEditorOutlinePage$DiffContentProvider.compactify(DiffEditorOutlinePage.java:572)
	at org.eclipse.egit.ui.internal.commit.DiffEditorOutlinePage$DiffContentProvider.computeFolders(DiffEditorOutlinePage.java:553)
	at org.eclipse.egit.ui.internal.commit.DiffEditorOutlinePage$DiffContentProvider.inputChanged(DiffEditorOutlinePage.java:484)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:278)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1634)
	at org.eclipse.egit.ui.internal.commit.DiffEditorOutlinePage.updateOutlineTreeMode(DiffEditorOutlinePage.java:440)
	at org.eclipse.egit.ui.internal.commit.DiffEditorOutlinePage.access$1(DiffEditorOutlinePage.java:423)
	at org.eclipse.egit.ui.internal.commit.DiffEditorOutlinePage$8.run(DiffEditorOutlinePage.java:415)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
	at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4443)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4229)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3839)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
Comment 1 Thomas Wolf CLA 2021-02-08 13:40:53 EST
Can be reproduced for instance by choosing two different rows with the same commit ID in the reflog view, then opening the unified diff. It'll come up empty, with an empty outline. Then click on the "Show nested folders" button in the outline toolbar.
Comment 2 Eclipse Genie CLA 2021-02-09 15:18:28 EST
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/176050