Skip to content

Report invalid Behavior Annex frozen ports 馃 - #3274

Merged
lwrage merged 2 commits into
masterfrom
3263_report_invalid_frozen_ports
Sep 20, 2026
Merged

lwrage merged 2 commits into
masterfrom
3263_report_invalid_frozen_ports

Conversation

@lwrage

@lwrage lwrage commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

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 a ClassCastException.

Cause and correction

DeclarativeToStrictTranslator.toDispatchCondition cast every resolved frozen reference directly to ActualPortHolder. A behavior variable resolves successfully as BehaviorVariableHolder, so unresolved-reference gating could not prevent the cast.

Translation now adds only ActualPortHolder values to the strict frozen-port list. BehaviorAnnexValidator checks every declarative frozen reference, reports a source diagnostic on non-port names, and gates strict checking when the translated condition is incomplete.

Regression

Issue3263Test uses 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/errors
  • Issue3167Test: 5 tests, 0 failures/errors
  • Full org.osate.ba.tests suite: 224 tests, 0 failures/errors
  • Clean root reactor with -o -T5, -Dtycho.localArtifacts=ignore, and clean install: 143 projects succeeded; 1,760 tests, 0 failures/errors/skips
  • git diff --check: passed

Dependencies 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.

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.
@lwrage
lwrage merged commit d4f380c into master Sep 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report invalid Behavior Annex frozen ports without a ClassCastException 馃

2 participants