Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340481 - Code Gen Annotations Model encoding.
Summary: Code Gen Annotations Model encoding.
Status: RESOLVED FIXED
Alias: None
Product: EMFT
Classification: Modeling
Component: Texo (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-19 03:36 EDT by Assen Sharlandjiev CLA
Modified: 2011-03-20 17:20 EDT (History)
0 users

See Also:


Attachments
Sample ECore model UTF-8 encoding (505 bytes, application/xml)
2011-03-19 03:37 EDT, Assen Sharlandjiev CLA
no flags Details
Generated Annotations Model, ASCII Encoded (1.72 KB, application/octet-stream)
2011-03-19 03:38 EDT, Assen Sharlandjiev CLA
no flags Details
Patch for AnnotationModelGenerator (1.54 KB, patch)
2011-03-20 05:10 EDT, Assen Sharlandjiev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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