-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AADL formatter exception when formatting annex without an EMF write transaction #2349
Comments
@lwrage from my perspective this is a core issue rather than a graphical editor issue even though it likely primarily affects the graphical editor. |
I think we can delete the requirement for a write transaction. IIRC, it's a leftover from before using Xtext. |
That would be very helpful. This used to work but something changed that caused this to start becoming an issue. We'll have annex related tests in the graphical editor in the near future which should catch any regressions. |
Is this something that could be fixed by the next release? As it is, it can cause issues by just having and annex subclause or library in a model. |
@lwrage I was able to confirm that this does not occur in the current stable version of OSATE. |
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. |
You are likely already aware of this, but this issue occurs regardless of whether the annex is even has a parser. Since the parsedAnnexSubclause/Library is set, the transaction error occurs. |
Summary
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
Environment
The text was updated successfully, but these errors were encountered: