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

Bug 407436

Summary: 'Overwrite' causes NPE in Compare editor
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: CompareAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: aegges, daniel_megert, lpet8473, markus.kell.r
Version: 4.3Flags: markus.kell.r: review+
Target Milestone: 4.3 RC1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Dani Megert CLA 2013-05-07 11:56:20 EDT
4.3 M7.

1. change a file
2. synchronize the project
3. click 'Next Difference' in the 'Synchronize' view to open the compare editor
4. select the file in the 'Synchronize' view
5. context menu > Overwrite

==>

!ENTRY org.eclipse.ui 4 4 2013-05-07 17:40:28.970
!MESSAGE An internal error has occurred.
!STACK 0
java.lang.NullPointerException
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.updateLines(TextMergeViewer.java:4028)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.access$66(TextMergeViewer.java:4020)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer$33.runInUIThread(TextMergeViewer.java:3015)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1109)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:993)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	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:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	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:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
	at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Dani Megert CLA 2013-05-07 11:58:17 EDT
This is caused by the fix for bug 405290.
Comment 2 Dani Megert CLA 2013-05-07 12:03:18 EDT
The reason for the bug is tricky: doDiff() can result in closing the editor if there are no changes left. Hence, the following calls fail. We need to add another isDisposed check.
Comment 3 Dani Megert CLA 2013-05-08 05:54:58 EDT
Created attachment 230638 [details]
Fix
Comment 4 Markus Keller CLA 2013-05-08 11:51:37 EDT
+1, fix is good.
Comment 6 Dani Megert CLA 2013-05-13 04:31:58 EDT
Verified in I20130512-2000.