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

Bug 344086

Summary: NPE while opening compare editor in changeset
Product: z_Archived Reporter: Benjamin Muskalla <b.muskalla>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: steffen.pingel
Version: unspecified   
Target Milestone: 0.8   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

Description Benjamin Muskalla CLA 2011-04-28 04:08:13 EDT
What steps will reproduce the problem?
1. Use egit change 3237
2. Changeset 1
3. Open plugin.properties from within reviews editor


-- Error Details --
Date: Thu Apr 28 10:06:31 CEST 2011
Message: Problems occurred when invoking code from plug-in: "org.eclipse.jface".
Severity: Error
Product: Eclipse SDK 3.7.0.v201008051700 (org.eclipse.sdk.ide)
Plugin: org.eclipse.jface
Exception Stack Trace:
java.lang.NullPointerException
at org.eclipse.mylyn.internal.reviews.ui.operations.ReviewCompareEditorInput.getContent(ReviewCompareEditorInput.java:98)
at org.eclipse.mylyn.internal.reviews.ui.operations.ReviewCompareEditorInput.<init>(ReviewCompareEditorInput.java:88)
at org.eclipse.mylyn.internal.gerrit.ui.editor.PatchSetSection$9.open(PatchSetSection.java:451)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:843)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1131)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1235)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298)
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:3552)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3171)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
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:369)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Comment 1 Steffen Pingel CLA 2011-05-07 20:46:04 EDT
Thanks. We'll need to investigate this.
Comment 2 Steffen Pingel CLA 2011-05-22 15:52:42 EDT
Turns out that this happens when a file is opened before the contents have been cached. I have added a check to catch that condition and display a warning instead.

As a work-around try again when opening fails. Once the content is cached it should work.
Comment 3 Steffen Pingel CLA 2011-05-22 15:52:44 EDT
Created attachment 196301 [details]
mylyn/context/zip