| Summary: | Refactoring opened model causes SWT to become unstable | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Victor Roldan Betancort <vroldanbet> | ||||||||
| Component: | Tools | Assignee: | Dave Steinberg <davidms> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | critical | ||||||||||
| Priority: | P1 | CC: | akarjakina, Ed.Merks, ed, Kenn.Hussey, richard.gronback, tikhomirov.artem, vsanchez | ||||||||
| Version: | unspecified | Flags: | richard.gronback:
pmc_approved+
Ed.Merks: pmc_approved+ davidms: review+ Ed.Merks: review+ Kenn.Hussey: review+ |
||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Victor Roldan Betancort
I think this is purely a workbench issue: org.eclipse.swt.SWTException: Graphic is disposed at org.eclipse.swt.SWT.error(SWT.java:3775) at org.eclipse.swt.SWT.error(SWT.java:3693) at org.eclipse.swt.SWT.error(SWT.java:3664) at org.eclipse.swt.graphics.Image.getBounds(Image.java:1145) at org.eclipse.swt.custom.CTabItem.drawSelected(CTabItem.java:378) at org.eclipse.swt.custom.CTabItem.onPaint(CTabItem.java:808) at org.eclipse.swt.custom.CTabFolder.drawTabArea(CTabFolder.java:1122) at org.eclipse.swt.custom.CTabFolder.onPaint(CTabFolder.java:2276) at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:321) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1026) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1011) at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1424) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3837) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4519) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2346) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3398) at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:172) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:370) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:317) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.internalPerformFinish(RefactoringWizard.java:558) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:154) at org.eclipse.ltk.ui.refactoring.resource.RenameResourceWizard$RenameResourceRefactoringConfigurationPage.performFinish(RenameResourceWizard.java:119) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:622) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:446) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:472) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3801) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3400) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:144) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:156) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:37) at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startRenameResourceRefactoring(RefactoringExecutionStarter.java:441) at org.eclipse.jdt.internal.ui.refactoring.actions.RenameResourceAction.run(RenameResourceAction.java:43) at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:110) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3801) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3400) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2387) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2203) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:112) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) 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:379) 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:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) at org.eclipse.equinox.launcher.Main.main(Main.java:1212) I'll investigate a bit more.... Created attachment 103726 [details]
Template changes to eliminate bogus call to dispose
The problem turns out to be that we are calling dispose on the editor directly and this causes the graphic for the editor to be disposed and thereby corrupts the whole IDE session. We need to change the editor template and regenerate our editors to fix this as I've done in this patch.
I can see that editors for UML and GMF need the same kind of attention; I'm not sure about OCL. Given that the workbench becomes completely unusable after this problem, I think it's very important to give the issue attention.
IWorkbenchPart is pretty clear about not calling this method (though I have to think we did the dispose at some time in the past because it wasn't happening otherwise, but that might have been 5 years ago):
* <p>
* Clients should not call this method (the workbench calls this method at
* appropriate times).
* </p>
*/
public void dispose();
This implies we need to regenerate our GMF editors for this release. Adding Artem, as we'll need a corresponding bug/approval. Created attachment 103732 [details]
Fix for the EMF Transaction workbench integration example editor
Attached a patch for the EMF Transaction component's example transactional editor.
MDT OCL doesn't have any editors.
Committers, please review.
Looks good to me, Ed. Simple, safe, and doesn't impact clients unless they re-generate (which is optional at this stage in the release). :-) (requesting review of my patch #103732 by David and Kenn) Both patches look good. (In reply to comment #4) > ... as we'll need a corresponding bug/approval. Rich, did you mean we need a separate bug with the fix or I can just attach a patch here and save a 2 pmc/2 committers votes step? (In reply to comment #9) > (In reply to comment #4) > > ... as we'll need a corresponding bug/approval. > > Rich, did you mean we need a separate bug with the fix or I can just attach a > patch here and save a 2 pmc/2 committers votes step? I'm fine with following Christian's lead and attaching here, seeing as it's just a 2 line deletion per editor. Created attachment 103742 [details] Fix for GMF Editors (In reply to comment #10) Yep, 2 lines per editor, 4 editors, 8 lines total gone. Note everyone that adding attachments kills prior approvals. :-( So all your approvals need to be reinstated... The EMF changes are committed to CVS. (In reply to comment #12) > Note everyone that adding attachments kills prior approvals. :-( So all your > approvals need to be reinstated... > Oops! I've just released my fix for EMF Transaction component. I'll assume that it's still approved. Apparently all the +'s are back. :-) My UMLX editors needed another 7 fixes.
My contributions to QVT Declarative and QVT OML need another 6.
While checking my editors, I noticed that one of my editors still had
if (delta.getFlags() != IResourceDelta.MARKERS &&
delta.getResource().getType() == IResource.FILE) {
if ((delta.getKind() & (IResourceDelta.CHANGED | IResourceDelta.REMOVED)) != 0) {
but the others have the more modern
if (delta.getResource().getType() == IResource.FILE) {
if (delta.getKind() == IResourceDelta.REMOVED ||
delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
which ensures that editors close on delete.
There appears to be a significant problem with propagating generated editor fixes.
I suggest that EMF publish as a constant the current genmodel template version, and that generated editor validate this against the template version that produced them. A suppressable Error Log entry would then detect existence of obsolete editors.
Invoking general all once per release is something uses should expect to do. If they don't consider that, they probably won't be looking at stamps either. Fix available in HEAD: 2.4.0RC4 (S200806091234). Fix available in HEAD: 1.2.0RC4 (S200806091902). |