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

Bug 455632

Summary: The sample Ecore modeler can create unserializable diagrams
Product: [Modeling] Sirius Reporter: Laurent Redor <laurent.redor>
Component: DiagramAssignee: Laurent Redor <laurent.redor>
Status: CLOSED FIXED QA Contact: Belqassim Djafer <belqassim.djafer>
Severity: normal    
Priority: P3 CC: florian.barbin, pierre-charles.david
Version: 0.9Keywords: triaged
Target Milestone: 3.0.0M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
My.ecore for steps to reproduce none

Description Laurent Redor CLA 2014-12-18 09:35:38 EST
Created attachment 249528 [details]
My.ecore for steps to reproduce

Steps to reproduce:
* Create a modeling project
* Add the joined My.ecore file in this project
* Enable the Viewpoint Design (of plugin org.eclipse.sirius.sample.ecore.design)
* Create a "package entities" representation on root package
* Save the session
* There is a NPE during load (see bug 455589 for the NPE problem).

In this case, the first cause of the NPE is not Sirius but the sample Ecore modeler itself that creates a label with an unserializable value.

The corresponding exception is "java.lang.RuntimeException: An invalid XML character (Unicode: 0x0) was found in the element content:att1 : EChar = ".
Comment 1 Laurent Redor CLA 2014-12-18 09:45:39 EST
The problem is in org.eclipse.sirius.ecore.design.service.EAttributeServices.renderDefaultValue(EAttribute, StringBuilder). The attr.getDefaultValue() returns the character '\u0000' (the default value for EChar data type).
Comment 2 Laurent Redor CLA 2014-12-18 10:36:09 EST
Review is available here: https://git.eclipse.org/r/38494
Comment 3 Pierre-Charles David CLA 2015-01-01 13:51:43 EST
Fixed by 717204ab5d9b971004e696c8a84112e8f52aa79c.
Comment 4 Pierre-Charles David CLA 2015-04-14 07:22:52 EDT
Apparently fixed for M5, but moving to M7 anyway so that is is validated with the rest and not forgotten.
Comment 5 Belqassim Djafer CLA 2015-05-21 11:40:26 EDT
Verified with Sirius 3.0.0 RC1
Comment 6 Pierre-Charles David CLA 2015-06-24 11:16:02 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.