| Summary: | Exception when serializing semantic model with 0.0 valued ecore::EDouble feature | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Thomas Williams <thwill> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | moritz.eysholdt |
| Version: | 2.1.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Thomas Williams
hi Thomas, thank you for your detailed bug report. I can confirm your observation that 0.0 has been marked as ValueTransient.YES by default. The status ValueTransient.YES explicitly disallows the serializer to serialize that value. (In reply to comment #0) > Speculation as to cause > ----------------------- > > The 'lowerBound' feature is being considered transient because 0.0 is the > default value for EDouble. I've fixed the DefaultTransientValueService so that default-values of EAttributes are now ValueTransient.PREFERABLY. This means that the serializer should not serialize that value, but is allowed to do so if it is required by the grammar. EAttributes with return type EString and default value null, however, remain ValueTransient.YES since Xtext's common.Terminal's STRING can not handle null. Your expectation of a changed output of the EMFFormatter is, however, not coming true. The EMFFormatter solely relies on the API of EMF. It'll show the value if EMF returns eIsSet(attribute) == true for it. This fix will be available with the Juno RC1 release of Xtext. Requested via bug 522520. -M. Requested via bug 522520. -M. |