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

Bug 324217

Summary: StructuredRegionProcessor should not be getting model in IModelLifecycleListener when model is being disposed
Product: [WebTools] WTP Source Editing Reporter: Ian Tewksbury <itewksbu>
Component: wst.sseAssignee: wst.sse <wst.sse-inbox>
Status: CLOSED DUPLICATE QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: nsand.dev
Version: 3.2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
JUnits that cause problem none

Description Ian Tewksbury CLA 2010-09-01 11:49:37 EDT
Created attachment 177975 [details]
JUnits that cause problem

The StructuredRegionProcessor should not be getting model in IModelLifecycleListener when model is being disposed.

This is causing an issue for new formatting tests being added in JSDT.  we are seeing the following exception stack trace:

org.eclipse.core.runtime.OperationCanceledException: Aborted cyclic load attempt for model with id: /FormattingTests/test4.html
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl$SharedObject.loop(ModelManagerImpl.java:170)
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl$SharedObject.waitForLoadAttempt(ModelManagerImpl.java:142)
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.getExistingModel(ModelManagerImpl.java:1137)
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.getExistingModelForRead(ModelManagerImpl.java:1252)
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl._getModelFor(ModelManagerImpl.java:616)
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.getModelForRead(ModelManagerImpl.java:1433)
	at org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor.getStructuredModelForRead(StructuredRegionProcessor.java:221)
	at org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor.access$1(StructuredRegionProcessor.java:218)
	at org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor$ModelLifecycleListener.processPreModelEvent(StructuredRegionProcessor.java:68)
	at org.eclipse.wst.sse.core.internal.model.LifecycleNotificationManager.signalLifecycleEvent(LifecycleNotificationManager.java:111)
	at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.signalLifecycleEvent(AbstractStructuredModel.java:1549)
	at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.setStructuredDocument(AbstractStructuredModel.java:1496)
	at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.setStructuredDocument(DOMModelImpl.java:868)
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.cleanupDiscardedModel(ModelManagerImpl.java:1895)
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.discardModel(ModelManagerImpl.java:1869)
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.releaseFromEdit(ModelManagerImpl.java:1805)
	at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.releaseFromEdit(ModelManagerImpl.java:1761)
	at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.releaseFromEdit(AbstractStructuredModel.java:1044)
	at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.releaseFromEdit(DOMModelImpl.java:804)
	at org.eclipse.wst.html.core.internal.document.DOMStyleModelImpl.releaseFromEdit(DOMStyleModelImpl.java:37)
	at org.eclipse.wst.jsdt.web.ui.tests.format.FormattingTests.formatAndAssertEquals(FormattingTests.java:209)
	at org.eclipse.wst.jsdt.web.ui.tests.format.FormattingTests.testFormatHTMLScript_WithHTMLTagInString_WithHTMLCommentStartAndEnd_advanded(FormattingTests.java:145)
	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:585)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.extensions.TestSetup.run(TestSetup.java:27)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:116)
	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:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	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.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47)
	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:585)
	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 Ian Tewksbury CLA 2010-09-01 11:52:45 EDT
Comment on attachment 177975 [details]
JUnits that cause problem

The attached patch is for the org.eclipse.wst.jsdt.web.ui.tests plugin.  Unfortunately just running The new FormattingTests does not cause this problem to happen you have to run the entire JSDT Junit suite. To do that you need to load all of the JSDT unit test plugins and then run the "JSDT Tests" plugin junit test suit that will automatically be loaded into your dev environment.
Comment 2 Nick Sandonato CLA 2011-04-13 10:13:32 EDT

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