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

Bug 501208

Summary: Open diff from git-staging cause exception and the diff view is "empty"
Product: [WebTools] JSDT Reporter: Andreas Höhmann <andreas.hoehmann>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: CLOSED DUPLICATE QA Contact: Victor Rubezhny <vrubezhny>
Severity: major    
Priority: P3 CC: helm, loskutov, mjdenham
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Andreas Höhmann CLA 2016-09-12 04:12:02 EDT
I'm using the nightly snapshot version

What steps will reproduce the problem?
1. double click on unstaged file in git staging view
2. diff editor is opened but without content
3. the error log contains this ...

-- Error Details --
Date: Mon Sep 12 10:09:07 CEST 2016
Message: Unhandled event loop exception
Severity: Error
Product: Eclipse 4.6.0.20160613-1800 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.ui
Exception Stack Trace:
org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.core.runtime.AssertionFailedException: assertion failed: )
	at org.eclipse.swt.SWT.error(SWT.java:4533)
	at org.eclipse.swt.SWT.error(SWT.java:4448)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4203)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3819)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: org.eclipse.core.runtime.AssertionFailedException: assertion failed: 
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
	at org.eclipse.jface.text.Position.<init>(Position.java:62)
	at org.eclipse.compare.structuremergeviewer.DocumentRangeNode.registerPositionUpdater(DocumentRangeNode.java:103)
	at org.eclipse.compare.structuremergeviewer.DocumentRangeNode.<init>(DocumentRangeNode.java:98)
	at org.eclipse.wst.jsdt.internal.ui.compare.JavaNode.<init>(JavaNode.java:51)
	at org.eclipse.wst.jsdt.internal.ui.compare.JavaParseTreeBuilder.push(JavaParseTreeBuilder.java:139)
	at org.eclipse.wst.jsdt.internal.ui.compare.JavaParseTreeBuilder.visit(JavaParseTreeBuilder.java:56)
	at org.eclipse.wst.jsdt.core.dom.JavaScriptUnit.accept0(JavaScriptUnit.java:235)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.internal.ui.compare.JavaStructureCreator.createStructureComparator(JavaStructureCreator.java:285)
	at org.eclipse.wst.jsdt.internal.ui.compare.JavaStructureCreator.createStructureComparator(JavaStructureCreator.java:243)
	at org.eclipse.compare.structuremergeviewer.StructureCreator.internalCreateStructure(StructureCreator.java:121)
	at org.eclipse.compare.structuremergeviewer.StructureCreator.access$0(StructureCreator.java:109)
	at org.eclipse.compare.structuremergeviewer.StructureCreator$1.run(StructureCreator.java:96)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.compare.internal.Utilities.runInUIThread(Utilities.java:859)
	at org.eclipse.compare.structuremergeviewer.StructureCreator.createStructure(StructureCreator.java:102)
	at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$StructureInfo.createStructure(StructureDiffViewer.java:155)
	at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$StructureInfo.refresh(StructureDiffViewer.java:133)
	at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$StructureInfo.setInput(StructureDiffViewer.java:104)
	at org.eclipse.compare.structuremergeviewer.StructureDiffViewer.compareInputChanged(StructureDiffViewer.java:347)
	at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$2.run(StructureDiffViewer.java:74)
	at org.eclipse.compare.structuremergeviewer.StructureDiffViewer$5.run(StructureDiffViewer.java:322)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.compare.structuremergeviewer.StructureDiffViewer.compareInputChanged(StructureDiffViewer.java:319)
	at org.eclipse.compare.structuremergeviewer.StructureDiffViewer.compareInputChanged(StructureDiffViewer.java:307)
	at org.eclipse.wst.jsdt.internal.ui.compare.JavaStructureDiffViewer.compareInputChanged(JavaStructureDiffViewer.java:143)
	at org.eclipse.compare.structuremergeviewer.StructureDiffViewer.inputChanged(StructureDiffViewer.java:278)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:286)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1696)
	at org.eclipse.compare.CompareViewerSwitchingPane.setInput(CompareViewerSwitchingPane.java:277)
	at org.eclipse.compare.internal.CompareStructureViewerSwitchingPane.setInput(CompareStructureViewerSwitchingPane.java:132)
	at org.eclipse.compare.CompareEditorInput.feedInput(CompareEditorInput.java:747)
	at org.eclipse.compare.CompareEditorInput.createContents(CompareEditorInput.java:555)
	at org.eclipse.compare.internal.CompareEditor.createCompareControl(CompareEditor.java:462)
	at org.eclipse.compare.internal.CompareEditor.access$6(CompareEditor.java:422)
	at org.eclipse.compare.internal.CompareEditor$1$1.run(CompareEditor.java:378)
	at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:162)
	at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:154)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
	... 24 more
Comment 1 Andrey Loskutov CLA 2016-09-12 07:10:32 EDT
(In reply to Andreas  Hoehmann from comment #0)
> I'm using the nightly snapshot version
Andreas, nightly version of *what*? Eclipse or egit? The error itself is coming from org.eclipse.wst.jsdt. Are you sure this is regression in egit, and not in platform or jsdt?
Comment 2 Andreas Höhmann CLA 2016-09-12 11:15:50 EDT
Andrey, I see only the "effect". I forgot to say that's actually a javascript file which is the unstaged resource where I want to see the git diff. Maybe the JS-Diff-Editor is the problem?
Comment 3 Andrey Loskutov CLA 2016-09-13 03:36:46 EDT
(In reply to Andreas  Hoehmann from comment #2)
> Andrey, I see only the "effect". I forgot to say that's actually a
> javascript file which is the unstaged resource where I want to see the git
> diff. Maybe the JS-Diff-Editor is the problem?

Andreas, can you please first answer to the question: which nightly build of what are you using? Is this regression with that particular build of something? What happens if you don't use nightly build but the last released version? 

After that: what happens if you run diff on non-js file? Have you tried that?
Comment 4 Andreas Höhmann CLA 2016-09-15 02:24:39 EDT
I used version:   4.5.0.201609090847
I tried with normal java files, property files ... is working.
Comment 5 Lutz Helm CLA 2019-01-22 09:54:24 EST
This bug has a duplicate that has some more helpful comments and attachments as well as a working workaround: bug 509820
Comment 6 Victor Rubezhny CLA 2020-03-19 18:31:18 EDT

*** This bug has been marked as a duplicate of bug 509820 ***