Join GitHub today
Running 'Check Realizability' analysis causes Xtext exception (and possible crash) #79
Running 'Check Realizability' analysis causes an IllegalStateException in Xtext errors as follows:
java.lang.IllegalStateException: The resource should have no more than one root element, but: [org.osate.aadl2.impl.AadlPackageImpl@2f336e00 (name: Top_System), org.osate.aadl2.impl.SystemImplementationImpl@2f51cb99 (name: Top_System.wrapper) (noPrototypes: false, noAnnexes: false, noProperties: false) (derivedModes: false, noFlows: false, noModes: false) (noSubcomponents: false, noConnections: false, noCalls: false)]
This can result in an infinite series repeated errors and essentially hang the UI because Xtext cannot complete its work.
Occurs on both Windows and Linux. (Given the nature of the error, that's expected.)
Duplicated with clean checkout of develop branch at hash 2af6b96.
The problem here seems to be that for Realizability analysis, the VerifyHandler creates an ephemeral system implementation for the selected system type and then applies the OSATE buildInstanceModelFile for the ephemeral instance. The combination of an otherwise unlinked system implementation and instantiation must violate an Xtext API rule.
This issue also affects the MATLAB codegen as it also uses the same combination of ephemeral implementation and instantiation as does Realizability.
Looks like one of two choices to solve this...
Looks like the latter is the way to go...