AADL formatter exception when formatting annex without an EMF write transaction #2349
An exception is thrown when saving an xtext resource which contains an AADL annex due to the lack of a write transaction. The AADL formatter re-parses the annex and updates the parsed annex which causes an exception.
In practice, this can occur when using the graphical editor if the xtext editor is not open. The graphical editor may run the formatter when getting the AADL text before and after a modification. All of the graphical editor's modifications are performed in an EMF transaction. I don't think the graphical editor should need to perform all saves in a write transaction.
Expected and Current Behavior
When formatting/saving a model with an annex in it, no exception should be thrown. An exception is thrown because the formatter is modifying the model so update the parsed annex library/subclause contained in the model as part of the formatting operation.
Steps to Reproduce
The text was updated successfully, but these errors were encountered:
This is not related to the transactional editing domain used in core OSATE so the above comment about removing the transaction requirement is invalid.
The root cause for this issue is the need for re-parsing the EMV2 annex to format it. This can be avoided only by creating a new AnnexParser interface for use by annexes that are based on Xtext. The current interface must be kept because the BA implementation is not Xtext based.