Skip to content

Validate EMV2 composite state target tokens 馃 - #3255

Merged
lwrage merged 2 commits into
masterfrom
2858_validate_composite_state_tokens
Sep 18, 2026
Merged

lwrage merged 2 commits into
masterfrom
2858_validate_composite_state_tokens

Conversation

@lwrage

@lwrage lwrage commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #2858

Composite error states now reject target tokens containing multiple types or a named type set, regardless of the condition used. The check previously ran from each subcomponent-state condition, so incoming-propagation and others conditions skipped it, and compound state conditions could report the same error twice.

Move the existing check to a CompositeState validator and remove it from condition validation. Each invalid target now receives one diagnostic. Single error types, type products, and omitted target tokens remain valid.

Issue2858Test uses external AADL models to cover the reported omissions, others, diagnostic duplication for a compound condition, and valid targets. Before the fix, the missing-diagnostic and duplicate-diagnostic assertions failed; the valid controls passed.

Validation:

  • Focused offline Tycho clean verify with -Dtest=Issue2858Test: 3 tests passed.
  • Full EMV2 suite: 306 tests passed, including all 5 Issue2604Test tests; no failures/errors/skips.
  • Clean offline root-reactor clean install: 1,688 tests, 0 failures/errors/skips; all reactor projects passed.
  • git diff --check passed.

Build flags: mvn -o -T5 -s releng/osate.releng/settings.xml -Plocal -Dpr.build=true -Dsign=false -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false -DfailIfNoTests=false. The focused and EMV2 suite runs use -pl :org.osate.xtext.aadl2.errormodel,:org.osate.aadl2.errormodel.tests,:org.osate.xtext.aadl2.errormodel.feature -Dtycho.localArtifacts=default; the root run uses -Dtycho.localArtifacts=ignore clean install.

No dependency on another unmerged PR. The change preserves the existing target-type restriction and condition-type checks; models previously missed by validation will now receive the required error.

Exercise invalid composite target tokens with incoming-propagation and others conditions, and require one diagnostic for a compound subcomponent condition. Cover legal single types, type products, and omitted target tokens in a separate external model.
Run the existing target-token restriction once per composite state instead of once per subcomponent condition. This validates incoming-propagation and others conditions, removes duplicate compound-condition diagnostics, and preserves optional tokens and legal type products.
@lwrage
lwrage merged commit 9491256 into master Sep 18, 2026
1 check passed
@lwrage
lwrage deleted the 2858_validate_composite_state_tokens branch September 18, 2026 18:05
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.

Missing validation for CompositeState.typedToken

2 participants