Bug 549918 - ClassCastException in VSM editor when selecting a tool from a Diagram Extension
Summary: ClassCastException in VSM editor when selecting a tool from a Diagram Extension
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 6.2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 6.2.3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2019-08-09 04:19 EDT by Pierre-Charles David CLA
Modified: 2019-08-26 08:37 EDT (History)
1 user (show)

See Also:


Attachments
Example project to reproduce the issue (845 bytes, application/zip)
2019-08-09 04:23 EDT, Pierre-Charles David CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2019-08-09 04:19:54 EDT
Commit 2a2a7ee1921adeed877a1a8b877212e745878ce6, which was supposed to be a simple cleanup, actually introduced a regression which causes a ClassCastException when the user selects a tool defined inside a DiagramExtension.

Steps to reproduce:
1. Import the attached project.
2. Open fixture.odesign. Make sure the "Properties" view is open.
3. Select the "Node Creation" tool => 

java.lang.ClassCastException: org.eclipse.sirius.diagram.description.impl.DiagramExtensionDescriptionImpl cannot be cast to org.eclipse.sirius.viewpoint.description.RepresentationDescription
	at org.eclipse.sirius.ui.business.internal.dialect.DialectUIManagerImpl.completeToolTipText(DialectUIManagerImpl.java:375)
	at org.eclipse.sirius.editor.properties.sections.tool.abstracttooldescription.AbstractToolDescriptionPreconditionPropertySection.getToolTipText(AbstractToolDescriptionPreconditionPropertySection.java:174)
	at org.eclipse.sirius.editor.properties.sections.tool.abstracttooldescription.AbstractToolDescriptionPreconditionPropertySection.createControls(AbstractToolDescriptionPreconditionPropertySection.java:117)
	at org.eclipse.ui.views.properties.tabbed.TabContents$1.run(TabContents.java:112)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:176)
	at org.eclipse.ui.views.properties.tabbed.TabContents.createControls(TabContents.java:115)
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage$SelectionChangedListener.selectionChanged(TabbedPropertySheetPage.java:215)

The commit that caused the regression is actually bogus, so the fix is simply to revert it.
Comment 1 Pierre-Charles David CLA 2019-08-09 04:23:21 EDT
Created attachment 279534 [details]
Example project to reproduce the issue
Comment 2 Eclipse Genie CLA 2019-08-09 04:48:41 EDT
New Gerrit change created: https://git.eclipse.org/r/147355