Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338870 - Exception after closing the editor and the build is happening
Summary: Exception after closing the editor and the build is happening
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Matthew Piggott CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-03 18:07 EST by Pascal Rapicault CLA
Modified: 2021-04-19 13:23 EDT (History)
1 user (show)

See Also:


Attachments
Check widget disposed status (1.29 KB, patch)
2011-03-07 11:05 EST, Matthew Piggott CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2011-03-03 18:07:40 EST
I have the following setup
A <- B <- C with only a dependency specified in A. 
I exclude a dependency from B, save, put focus on the dep hierarchy page, undo, save, close the editor (last 3 steps need to be done quickly), and you get the following exception.

org.eclipse.core.runtime.AssertionFailedException: assertion failed: ContentViewer must have a content provider when input is set.
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:266)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1664)
	at org.eclipse.m2e.editor.pom.DependencyTreePage.loadData(DependencyTreePage.java:195)
	at org.eclipse.m2e.editor.pom.DependencyTreePage.loadData(DependencyTreePage.java:1033)
	at org.eclipse.m2e.editor.pom.DependencyTreePage$16.runInUIThread(DependencyTreePage.java:1045)
	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:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3586)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3279)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	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)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 1 Matthew Piggott CLA 2011-03-07 11:05:05 EST
Created attachment 190562 [details]
Check widget disposed status

This is a timing issue that the hierarchy page has, it uses a listener for maven change events from builds to trigger updates the viewers, as this all happens asynchronously the user can close the wizard while the jobs are running.

The attached patch adds a few simple checks before touching widgets to make sure they aren't disposed.  It might not catch every case but I think it should be sufficient.
Comment 2 Milos Kleint CLA 2011-03-09 02:42:08 EST
(In reply to comment #1)
> Created attachment 190562 [details]
> Check widget disposed status
> 
> This is a timing issue that the hierarchy page has, it uses a listener for
> maven change events from builds to trigger updates the viewers, as this all
> happens asynchronously the user can close the wizard while the jobs are
> running.
> 
> The attached patch adds a few simple checks before touching widgets to make
> sure they aren't disposed.  It might not catch every case but I think it should
> be sufficient.


matt, the attached patch only touches the UIIntegrationTestCase class and the commit message says "Fix for broken test". Your comment in the issue leads me to believe you attached the wrong thing here?
Comment 3 Matthew Piggott CLA 2011-03-09 10:44:40 EST
Yep, not sure how I lost that change.  I've recreated it and pushed it.

To test this:
1) Open a POM with a dependency
2) Flip to the dependency hierarchy view
3) quickly in sequence remove the dependency, save and close the editor

Prior to the change if step-3 was performed quickly enough asynchronous jobs would touch the disposed viewers.

http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=cdf5bfa6cfc385504bc3b1ed9fe31a544cbf7651
Comment 4 Pascal Rapicault CLA 2011-03-10 11:48:37 EST
verified
Comment 5 Denis Roy CLA 2021-04-19 13:23:46 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/