Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332016 - [Profile] ClassCastException in context menu
Summary: [Profile] ClassCastException in context menu
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.7.1   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: M4   Edit
Assignee: Patrick Tessier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-07 08:51 EST by Camille Letavernier CLA
Modified: 2012-03-28 05:13 EDT (History)
1 user (show)

See Also:
sebastien.gerard: indigo+


Attachments
Correction : Test added before cast (896 bytes, patch)
2010-12-07 08:54 EST, Camille Letavernier CLA
rschnekenburger: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Camille Letavernier CLA 2010-12-07 08:51:29 EST
The AbstractViewActionDelegate#selectionChanged method does not test if the selected EObject is an UML Element before cast, which causes errors in some other contexts :

java.lang.ClassCastException: org.eclipse.papyrus.properties.contexts.impl.SectionImpl cannot be cast to org.eclipse.uml2.uml.Element
	at org.eclipse.papyrus.profile.ui.actions.AbstractViewActionDelegate.setSelectedElement(AbstractViewActionDelegate.java:94)
	at org.eclipse.papyrus.profile.ui.actions.AbstractViewActionDelegate.selectionChanged(AbstractViewActionDelegate.java:76)
	at org.eclipse.ui.internal.PluginAction.refreshEnablement(PluginAction.java:206)
	at org.eclipse.ui.internal.PluginAction.selectionChanged(PluginAction.java:277)
	at org.eclipse.ui.internal.ObjectActionContributor$1.run(ObjectActionContributor.java:157)
	[...]
Comment 1 Camille Letavernier CLA 2010-12-07 08:54:06 EST
Created attachment 184717 [details]
Correction : Test added before cast
Comment 2 Patrick Tessier CLA 2011-07-28 05:31:50 EDT
Fix in the revision 5145 for the branch
a test has been added
Comment 3 Patrick Tessier CLA 2011-07-28 05:36:38 EDT
Merge has been done for the head revision 5146