Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318391 - MoDisco: Open *.genmodel leads to a recursive attempt to open the property view.
Summary: MoDisco: Open *.genmodel leads to a recursive attempt to open the property view.
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: MoDisco
Classification: Modeling
Component: Infrastructure (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Fabien Giquel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 321630
Blocks:
  Show dependency tree
 
Reported: 2010-06-29 18:18 EDT by Nicolas Rouquette CLA
Modified: 2010-10-04 13:53 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Rouquette CLA 2010-06-29 18:18:12 EDT
Opening a *.genmodel file in MoDisco leads to a recursive attempt to open the property view.
This leads to a stack overflow condition. Fortunately, I was running in a runtime Eclipse instance so I managed to get an error from the Eclipse debugger.

java.lang.RuntimeException: WARNING: Prevented recursive attempt to activate part org.eclipse.ui.views.PropertySheet while still in the middle of activating part org.eclipse.emf.codegen.ecore.genmodel.presentation.GenModelEditorID
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3487)
at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:3077)
at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:279)
at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:237)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1371)
at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1355)
at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2954)
at org.eclipse.swt.widgets.Display.checkFocus(Display.java:618)
at org.eclipse.swt.widgets.Shell.makeFirstResponder(Shell.java:1112)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5086)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend_bool(Native Method)
at org.eclipse.swt.internal.cocoa.NSWindow.makeFirstResponder(NSWindow.java:186)
at org.eclipse.swt.widgets.Control.forceFocus(Control.java:1299)
at org.eclipse.swt.widgets.Control.forceFocus(Control.java:1290)
at org.eclipse.swt.widgets.Control.setFocus(Control.java:3315)
at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1022)
at org.eclipse.swt.widgets.Control.fixFocus(Control.java:1218)
at org.eclipse.swt.widgets.Control.setVisible(Control.java:3772)
at org.eclipse.jface.viewers.CellEditor.deactivate(CellEditor.java:274)
at org.eclipse.ui.views.properties.PropertySheetViewer.deactivateCellEditor(PropertySheetViewer.java:403)
at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:964)
at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:510)
at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:365)
at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156)
at org.eclipse.ui.internal.AbstractSelectionService.setActivePart(AbstractSelectionService.java:282)
at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:60)
at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:136)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3537)
at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:3077)
at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:279)
at org.eclipse.ui.internal.EditorPane.requestActivation(EditorPane.java:98)
at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:237)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1371)
at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1355)
at org.eclipse.swt.widgets.Control.sendMouseEvent(Control.java:3018)
at org.eclipse.swt.widgets.Control.mouseEvent(Control.java:2226)
at org.eclipse.swt.widgets.Composite.mouseEvent(Composite.java:878)
at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2236)
at org.eclipse.swt.widgets.Tree.mouseDown(Tree.java:1937)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4976)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1943)
at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2008)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5040)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4582)
at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4659)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3274)
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 Nicolas Rouquette CLA 2010-06-29 18:19:09 EDT
I'm using Eclipse Helios with the latest/greatest MoDisco available from Modeling discovery...
Comment 2 Nicolas Bros CLA 2010-07-01 09:57:02 EDT
(In reply to comment #0)
> Opening a *.genmodel file in MoDisco
What do you mean by that? Are you trying to open a genmodel file in the MoDisco model browser? I tested it, and it works for me with a simple genmodel file.

Looking at the stacktrace you provided, it looks like the editor being opened is the GenModel editor. And I don't see any MoDisco code in the stacktrace.

Could you provide more information on how to reproduce the problem?
Comment 3 Nicolas Rouquette CLA 2010-07-16 20:33:56 EDT
You're right, it does work; I might have had some other problem in my environment.
However, I get the following error when I close this genmodel file:

/org.eclipse.uml2.uml/model/UML.genmodel (version 1.67 from CVS)

java.lang.NullPointerException
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenOperationImpl.isInvariant(GenOperationImpl.java:1062)
	at org.eclipse.uml2.codegen.ecore.genmodel.impl.GenOperationImpl.getName(GenOperationImpl.java:330)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.eURIFragmentSegment(GenBaseImpl.java:2370)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getURIFragment(ResourceImpl.java:678)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.getURIFragment(XMLResourceImpl.java:423)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.unloaded(ResourceImpl.java:1563)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.doUnload(ResourceImpl.java:1624)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doUnload(XMLResourceImpl.java:506)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.unload(ResourceImpl.java:1639)
	at org.eclipse.gmt.modisco.infra.browser.editors.EcoreBrowser$14.run(EcoreBrowser.java:1721)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

(I have modisco version 0.8.0.v201006150543)
Comment 4 Fabien Giquel CLA 2010-07-27 08:59:47 EDT
Hi Nicolas,

i could not get the error you get with with UML.genmodel 1.67.
Looking into the code (not MoDisco code but uml code), and looking into the uml.genmodel/uml.ecore, such a NPE on GenOperation#getName() may occur only if the GenParameter or EParameter elements were explicitely modified in editor. 
Have you made such a model modification before closing the editor ?

Fabien.
Comment 5 Nicolas Rouquette CLA 2010-07-31 23:49:15 EDT
Fabien,

Try this:
- open UML.genmodel 1.67
- in the types browser, select GenOperation (654)
- in the instances browser, select any operation -- e.g., the first one: action_referenced
- expand the 'ecoreOperation(1)' sub-entry

Notice how the instance: [EOperation] action_referenced(...) is highlighted blue?

The simple act of browsing a *.genmodel that has EOperations seems to cause modifications to the model.
What's strange is that the MoDisco browser doesn't have the modification indicator.

- Close the model:

java.lang.NullPointerException
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenOperationImpl.isInvariant(GenOperationImpl.java:1062)
	at org.eclipse.uml2.codegen.ecore.genmodel.impl.GenOperationImpl.getName(GenOperationImpl.java:330)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.eURIFragmentSegment(GenBaseImpl.java:2370)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getURIFragment(ResourceImpl.java:678)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.getURIFragment(XMLResourceImpl.java:423)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.unloaded(ResourceImpl.java:1563)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.doUnload(ResourceImpl.java:1624)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doUnload(XMLResourceImpl.java:506)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.unload(ResourceImpl.java:1639)
	at org.eclipse.gmt.modisco.infra.browser.editors.EcoreBrowser$14.run(EcoreBrowser.java:1721)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 6 Fabien Giquel CLA 2010-08-03 12:39:25 EDT
I submit some related issue on UML.genmodel unloading in 321630.
Comment 7 Nicolas Rouquette CLA 2010-08-03 15:41:22 EDT
Well, I'm glad you figured out the root cause of this mysterious behavior.
Comment 8 Fabien Giquel CLA 2010-09-09 04:14:02 EDT
Bug 321360 has been set as wontfix. 
Meanwhile the 321687 has removed the unnecessary .unload() calls when closing ModlBrowser, so the issue is indirectly fixed for MoDisco browser close action.
Comment 9 Hugo Bruneliere CLA 2010-10-04 13:53:28 EDT
Bug fixed.