Project

General

Profile

Bug #2138

Component architecture: creating a channel from an existing port to the parent component results in a ClassCastException

Added by Simon Barner about 6 years ago. Updated over 5 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Start date:
10/07/2014
Due date:
% Done:

0%

Estimated time:

Description

Steps to reproduce (see also attached screenshot)

  1. Create a Component architecture
  2. Add a new component ("C")
  3. Add a new output port "p" to C
  4. Try to create a channel from "p" to the parent of "C" (i.e., the Component Architecture ("parent")
  5. Observe below exception
Analysis
  • Trying to create a connection from "C" to the Component Architecture does not result in an exception. In this case, org.fortiss.tooling.base.ui.editpart.command.ConnectCommand is not triggered. In this case, the responsible compositor is the ComponentConnectionCompositor
  • I guess that the root of the bug is in PortComponentConnectionCompositor (or one of its base classes) who's canConnect() implementation erroneously returns true for the connection from "p" to "parent"
  • Alternatively, the problem could also be by in the target connector creation logic (or at least, this could provide a different way to fix this bug)
  • Observe, that problem exists recursively, i.e. if "parent" is not the Component Architecture
!ENTRY org.eclipse.emf.common 2 0 2014-10-07 10:15:07.135
!MESSAGE An exception was ignored during command execution
!STACK 0
org.eclipse.emf.common.util.WrappedException: An exception was ignored during command execution
    at org.eclipse.emf.common.command.BasicCommandStack.handleError(BasicCommandStack.java:281)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.handleError(AbstractTransactionalCommandStack.java:125)
    at org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:112)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.basicExecute(AbstractTransactionalCommandStack.java:241)
    at org.eclipse.emf.transaction.impl.TransactionalCommandStackImpl.doExecute(TransactionalCommandStackImpl.java:63)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
    at org.fortiss.tooling.kernel.internal.storage.eclipse.AutoUndoCommandStack.execute(AutoUndoCommandStack.java:84)
    at org.fortiss.tooling.kernel.internal.storage.eclipse.ModelContext.runAsCommand(ModelContext.java:258)
    at org.fortiss.tooling.base.ui.internal.command.GEF2ToolingKernelCommandStack.execute(GEF2ToolingKernelCommandStack.java:72)
    at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
    at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
    at org.eclipse.gef.tools.AbstractConnectionCreationTool.handleCreateConnection(AbstractConnectionCreationTool.java:256)
    at org.eclipse.gef.tools.ConnectionDragCreationTool.handleButtonUp(ConnectionDragCreationTool.java:63)
    at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
    at org.eclipse.gef.tools.SelectionTool.mouseUp(SelectionTool.java:574)
    at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
    at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
    at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.fortiss.af3.rcp.application.AF3Application.start(AF3Application.java:48)
    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:354)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to org.eclipse.emf.ecore.EObject
    at org.fortiss.tooling.base.ui.editpart.command.ConnectCommand.execute(ConnectCommand.java:73)
    at org.fortiss.tooling.base.ui.internal.command.GEF2ToolingKernelCommandStack$1.run(GEF2ToolingKernelCommandStack.java:76)
    at org.fortiss.tooling.kernel.internal.storage.eclipse.ModelContext$2.execute(ModelContext.java:267)
    at org.fortiss.tooling.kernel.internal.storage.eclipse.EMFTransactionalCommand$1.doExecute(EMFTransactionalCommand.java:60)
    at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
    at org.fortiss.tooling.kernel.internal.storage.eclipse.EMFTransactionalCommand$2.run(EMFTransactionalCommand.java:72)
    at org.fortiss.tooling.kernel.internal.storage.eclipse.EMFTransactionalCommand.runInTransaction(EMFTransactionalCommand.java:104)
    at org.fortiss.tooling.kernel.internal.storage.eclipse.EMFTransactionalCommand.execute(EMFTransactionalCommand.java:69)
    at org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:78)
    ... 43 more
connection_bug.png (5.96 KB) connection_bug.png Simon Barner, 10/07/2014 10:29 AM

History

#1 Updated by Anonymous over 5 years ago

  • Assignee set to Anonymous

#2 Updated by Simon Barner over 5 years ago

  • Steps to reproduce are correct (they describe an action that would not alter the model)
  • Cannot reproduce on my machine, either
  • Might have been fixed along the line of #2233
    • Note that the fix in #2233 affects HierarchicElementConnectorConnectionCompositorBase, whereas the analysis in this issue refers to PortComponentConnectionCompositor (whose base class is ConnectorHierarchicElementConnectionCompositorBase). Hence, potentially the analysis was wrong.
    • #2235 proposes changes to ConnectorHierarchicElementConnectionCompositorBase

#3 Updated by Anonymous over 5 years ago

  • Status changed from New to Rejected

Ok, we just reject then.

Also available in: Atom PDF