Report invalid Behavior Annex frozen ports 馃 - #3274
Merged
Merged
Conversation
Model a behavior variable in a dispatch frozen list and assert that validation reports the reference instead of a generic validator failure. Verify direct strict translation omits the invalid value while preserving a valid incoming frozen port.
Translate only frozen references that have an ActualPortHolder representation and validate the written list before running strict checkers. This replaces the unchecked cast with a source diagnostic while preserving valid incoming frozen ports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3263.
Behavior Annex validation now reports a frozen-list name that cannot be represented as a port instead of falling back to
Error executing EValidator. Direct strict-model translation also omits the invalid value rather than raising aClassCastException.Cause and correction
DeclarativeToStrictTranslator.toDispatchConditioncast every resolved frozen reference directly toActualPortHolder. A behavior variable resolves successfully asBehaviorVariableHolder, so unresolved-reference gating could not prevent the cast.Translation now adds only
ActualPortHoldervalues to the strict frozen-port list.BehaviorAnnexValidatorchecks every declarative frozen reference, reports a source diagnostic on non-port names, and gates strict checking when the translated condition is incomplete.Regression
Issue3263Testuses external AADL model projects for an invalid behavior-variable frozen reference and a valid incoming-port control. It verifies the diagnostic code, message, and source range; confirms invalid direct translation no longer throws; and confirms the valid port remains in the strict model. Corpus diagnostics, positions, resolved-model, and unparse goldens cover both fixtures. The malformed covering-syntax characterization now records the partial strict model that translation can safely produce.Validation
Issue3263Test: 3 tests, 0 failures/errorsIssue3167Test: 5 tests, 0 failures/errorsorg.osate.ba.testssuite: 224 tests, 0 failures/errors-o -T5,-Dtycho.localArtifacts=ignore, andclean install: 143 projects succeeded; 1,760 tests, 0 failures/errors/skipsgit diff --check: passedDependencies and residual risk
No PR dependency or merge-order constraint.
This change enforces the representation boundary needed to prevent the exception. The broader D.4 direction, dispatch-protocol, and effective-property compatibility matrix remains tracked by #3187.