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

Bug 340481

Summary: Code Gen Annotations Model encoding.
Product: [Modeling] EMFT Reporter: Assen Sharlandjiev <assen.sharlandjiev>
Component: TexoAssignee: Martin Taal <mtaal>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Sample ECore model UTF-8 encoding
none
Generated Annotations Model, ASCII Encoded
none
Patch for AnnotationModelGenerator none

Description Assen Sharlandjiev CLA 2011-03-19 03:36:11 EDT
Dear Martin,

Consider an Ecore model with UTF-8 encoding, containing EEnum with literals in cyrilic.
When I generate  Code Gen Annotated Model from this ECore model, the resulting .annotationsmodel has ASCII encoding.
It appears that the Annotated Model generator does not respect the encoding of the source ECore model.
Further, I am not able to edit the generated annotations model with the Annotationsmodel Model Editor, as this results in exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x{2}) was found in the value of attribute "{1}" and element is "1d".
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
....
Caused by: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x{2}) was found in the value of attribute "{1}" and element is "1d".

Would you please fix the annotations model generator to respect the encoding defined in the ECore model, and use the same in the generated annotations model.

Thank you in advance.
Comment 1 Assen Sharlandjiev CLA 2011-03-19 03:37:41 EDT
Created attachment 191562 [details]
Sample ECore model UTF-8 encoding
Comment 2 Assen Sharlandjiev CLA 2011-03-19 03:38:18 EDT
Created attachment 191563 [details]
Generated Annotations Model, ASCII Encoded
Comment 3 Assen Sharlandjiev CLA 2011-03-20 05:10:50 EDT
Created attachment 191572 [details]
Patch for AnnotationModelGenerator
Comment 4 Assen Sharlandjiev CLA 2011-03-20 05:14:17 EDT
Hi Martin,

Please review the attached patch. It should solve the problem.
If it is okay, please commit it and run a build.

Thank you.
Comment 5 Martin Taal CLA 2011-03-20 17:20:57 EDT
Hi Assen,
Your patch has been applied and new build has been published.

Thanks!

gr. Martin