Bug 403827 - NPE when comparing two files
Summary: NPE when comparing two files
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.3 M7   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 405350 (view as bug list)
Depends on: 216407
Blocks: 367725
  Show dependency tree
 
Reported: 2013-03-19 14:00 EDT by Szymon Ptaszkiewicz CLA
Modified: 2013-04-10 08:54 EDT (History)
5 users (show)

See Also:


Attachments
patch v.1 (1.29 KB, patch)
2013-03-25 12:13 EDT, Piotr Aniola CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Ptaszkiewicz CLA 2013-03-19 14:00:42 EDT
Build id: I20130312-2000

I was hit by the following exception when I was editing left file (not sure if typing or saving after Ctrl+S):

java.lang.NullPointerException
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.doDiff(TextMergeViewer.java:3317)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer.access$64(TextMergeViewer.java:3316)
	at org.eclipse.compare.contentmergeviewer.TextMergeViewer$33.runInUIThread(TextMergeViewer.java:3003)
	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:1108)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:992)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:137)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:600)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:555)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	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(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:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)


Seems to be caused by fix for bug 216407.
Comment 1 Ed Willink CLA 2013-03-21 12:15:37 EDT
M6. This occurs for me when using GIT compare.
Comment 2 Piotr Aniola CLA 2013-03-25 12:12:58 EDT
This is a race condition.
I was able to reproduce it by stopping execution on a breakpoint and closing the compare editor before the scheduled diff action fired.
Comment 3 Piotr Aniola CLA 2013-03-25 12:13:32 EDT
Created attachment 229001 [details]
patch v.1
Comment 4 Malgorzata Janczarska CLA 2013-03-25 12:33:28 EDT
(In reply to comment #3)
> Created attachment 229001 [details]
> patch v.1

Piotr, you are proposing to change code that was changed in Bug 216407. Could you first check if Bug 403666 is caused by the fix in Bug 216407? Maybe the solution for Bug 216407 is not good and we will have to withdraw it anyway?
Comment 5 Dani Megert CLA 2013-03-26 10:16:13 EDT
I've reverted the fix for bug 216407.
Comment 6 Dani Megert CLA 2013-03-27 04:44:30 EDT
Verified in N20130326-2000.
Comment 7 Szymon Ptaszkiewicz CLA 2013-04-10 08:51:56 EDT
*** Bug 405350 has been marked as a duplicate of this bug. ***