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

Bug 432931

Summary: [Xtext] Work around false positives in ConcreteSyntax validators
Product: [Modeling] Sirius Reporter: Cedric Brun <cedric.brun>
Component: CoreAssignee: Cedric Brun <cedric.brun>
Status: CLOSED FIXED QA Contact: Pierre-Charles David <pierre-charles.david>
Severity: normal    
Priority: P3 CC: maxime.porhel, pierre-charles.david
Version: 1.0.0M6Keywords: triaged
Target Milestone: 1.0.0M7   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Cedric Brun CLA 2014-04-16 10:42:12 EDT
Xtext have at least one issue with the concrete syntax validator which throw an exception when doing resource.save().

See bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=432795

This might lead to data loss, if the exception is thrown then the underlying file is emptied.

The xtext team mentionned a save option to disable this extra validation. This bug is an umbrella for the work of using this option by default in Sirius.
Comment 1 Cedric Brun CLA 2014-04-16 10:58:10 EDT
Change submitted here : https://git.eclipse.org/r/#/c/25152/
Comment 2 Maxime Porhel CLA 2014-04-18 04:44:14 EDT
Cedric, could you indicate how to reproduce the issue / check the correction ? 

Do you have a simple reproduction case ?
Comment 3 Cedric Brun CLA 2014-04-18 05:11:25 EDT
Yep,

1- install Sirius with the Xtext integration feature
2- install EcoreTools 2.0.x 
3- install Xcore
4- create a new Xcore project, create an Xcore file with for instance :
package library 

class Library {

}
5- create an .aird on top of this Xcore file
6- create a new diagram on top of the EPackage instance which is contained in this Xcore file
7- change something using the diagram like, for instance, renaming the Library EClass (not required with the current saving policy which will try to save the Xcore file anyway)
7- save => you'll get the exception
Comment 4 Maxime Porhel CLA 2014-04-18 05:40:19 EDT
Thanks. 

I have assigned this issue to Cedric as he proposed a patch set on Gerrit.
Comment 5 Pierre-Charles David CLA 2014-04-28 07:57:55 EDT
Fixed by be137d326d439d98d3844deb2999b59126d91d13.
Comment 6 Pierre-Charles David CLA 2014-05-05 09:34:43 EDT
Verified on 1.0.0M7rc1 (1.0.0.20405030833).
Comment 7 Pierre-Charles David CLA 2014-05-12 03:45:34 EDT
Available in Sirius 1.0.0M7 (see https://wiki.eclipse.org/Sirius/1.0.0M7 & http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/tag/?id=v1.0.0M7).