Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 490092

Summary: ClassCast Exception in table for multivalued attributes shown in a feature column
Product: [Modeling] Sirius Reporter: Goulwen Le Fur <goulwen.lefur>
Component: TableAssignee: Steve Monnier <steve.monnier>
Status: CLOSED FIXED QA Contact: Florian Barbin <florian.barbin>
Severity: normal    
Priority: P3 CC: florian.barbin, pierre-charles.david, steve.monnier
Version: 3.1.0Keywords: triaged
Target Milestone: 4.0.0M7   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/69323
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=fe7fc1653ae059b5a970ea501a8059b8b975125e
https://git.eclipse.org/r/71449
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d26c35de7e165ff3576616407ee88bd21c77d913
https://git.eclipse.org/r/71503
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=91288f0904fb9b4958640e20ceebac37a7a0071c
Whiteboard:
Attachments:
Description Flags
Source workspace for sample
none
Model workspace for sample none

Description Goulwen Le Fur CLA 2016-03-21 10:08:23 EDT
Created attachment 260447 [details]
Source workspace for sample

Sirius try to cast List<String> into List<EObject> when a EString[*] attributes is mapped in a Feature Column.

java.lang.ClassCastException: java.lang.String cannot be cast to org.eclipse.emf.ecore.EObject
	at org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.setLabelWithFeatureValue(DTableElementSynchronizerSpec.java:509)
	at org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.refreshLabel(DTableElementSynchronizerSpec.java:483)
	at org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.refreshLabel(DTableElementSynchronizerSpec.java:314)
	at org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refresh(DTableSynchronizerImpl.java:335)
	at org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.fillTableDCell(DTableSynchronizerImpl.java:302)
Comment 1 Goulwen Le Fur CLA 2016-03-21 10:09:00 EDT
Created attachment 260448 [details]
Model workspace for sample
Comment 2 Eclipse Genie CLA 2016-03-25 10:27:59 EDT
New Gerrit change created: https://git.eclipse.org/r/69323
Comment 4 Pierre-Charles David CLA 2016-04-11 07:49:53 EDT
The actual bug is fixed, but it's missing clear reproduction steps (for verification purposes) and an automated regression test.
Comment 5 Eclipse Genie CLA 2016-04-26 11:13:48 EDT
New Gerrit change created: https://git.eclipse.org/r/71449
Comment 7 Eclipse Genie CLA 2016-04-27 05:04:55 EDT
New Gerrit change created: https://git.eclipse.org/r/71503
Comment 9 Steve Monnier CLA 2016-04-27 05:11:23 EDT
The test TableWithMultivaluedAttributeTest was added to the tests suite.

Manual validation steps:
- Import the projects from the attachment "Source workspace for sample"
- Launch an Eclipse runtime
- In this Eclipse runtime, import the project from the attachment "Modelworkspace for sample"
- The project is a modeling session named sample that provide a table representation. Open the table and validate that no ClassCastException was raised.
Comment 10 Pierre-Charles David CLA 2016-05-09 08:31:12 EDT
Removing "needtest" tag, as the test was merged.
Comment 11 Florian Barbin CLA 2016-05-26 03:39:56 EDT
Verified on Sirius 4.0.0.RC1
Comment 12 Pierre-Charles David CLA 2016-06-24 08:01:03 EDT
Available in Sirius 4.0.0.