Bug 115521 - Correctly generate initialization code then Enumeration literal is used as an init value
Summary: Correctly generate initialization code then Enumeration literal is used as an...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Tooling (ARCHIVED)
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Radomil Dvorak CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-11-08 13:16 EST by Alex Shatalin CLA
Modified: 2010-07-19 22:18 EDT (History)
0 users

See Also:


Attachments
Templates (5.64 KB, patch)
2006-01-26 12:32 EST, Artem Tikhomirov CLA
no flags Details | Diff
Tests (10.31 KB, patch)
2006-01-26 12:32 EST, Artem Tikhomirov CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Shatalin CLA 2005-11-08 13:16:33 EST
- Create mapping with an feature Seq initializer in it
- Create Feature Value Spec in initializer
- Specify some feature of the domain object which has type = instance of EEnum 
presenting in the domain model
- Specify body for that initializer which will reference literal from that 
enumeration (e.g. in case of usage uml2 as a metamodel, initializer will looks 
like: "AggregationKind::composite")
- Try to generate code and execute it - ClassCast exception appear on trying 
to set value for the specified feature. 

The reason is - instance of EEnumLiteral is returned from the evaluation code 
then "AggregationKind::composite" is passed as an expression. From the other 
side, eSet(Object) is waiting for an instance of AggregationKind which will be 
available as a ".instance()" value of returned EEnumLiteral.
Comment 1 Artem Tikhomirov CLA 2006-01-26 12:32:04 EST
Created attachment 33658 [details]
Templates
Comment 2 Artem Tikhomirov CLA 2006-01-26 12:32:39 EST
Created attachment 33659 [details]
Tests
Comment 3 Artem Tikhomirov CLA 2006-01-26 12:33:37 EST
Reviewed and committed.
Comment 4 Eclipse Webmaster CLA 2010-07-19 22:18:28 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Generation was the original product and component for this bug