Skip to content

Validate mode mappings in modal EMV2 subclauses 馃 - #3254

Merged
lwrage merged 2 commits into
masterfrom
2832_validate_modal_mode_mappings
Sep 18, 2026
Merged

lwrage merged 2 commits into
masterfrom
2832_validate_modal_mode_mappings

Conversation

@lwrage

@lwrage lwrage commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #2832

Mode mappings in a modal EMV2 subclause now report an error for each mapped mode absent from the enclosing annex's in modes list. Previously, mode scoping resolved any mode of the classifier, and validation did not enforce the subclause's mode restriction.

Issue2832Test reproduces the issue and a mixed mapping containing both allowed and disallowed modes. It checks all three diagnostics and verifies that each highlights the offending mode reference. Separate external models cover unrestricted subclauses, allowed subsets, inherited modes, and unresolved references that should produce only their existing linking error. The regression failed before the fix because the modal diagnostic was absent; all three tests pass afterward.

Validation:

  • Focused offline Tycho clean verify with -Dtest=Issue2832Test: 3 tests passed.
  • Clean offline root-reactor clean install: 1,683 tests, 0 failures/errors/skips; all reactor projects passed, including all 301 EMV2 tests.
  • 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 run uses -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 PR. The check only restricts mappings in explicitly modal annex subclauses and skips unresolved mapped modes. Existing scoping, parsing, and instantiation behavior are preserved.

Reproduce mode mappings that reference modes outside their modal EMV2 subclause and require diagnostics on the offending references. Cover allowed subsets, nonmodal subclauses, inherited modes, and unresolved references with separate external models.
Require each resolved mapped mode to occur in the enclosing annex subclause in-modes list. Highlight the offending mode reference while preserving unrestricted subclauses, inherited modes, and existing unresolved-reference diagnostics.
@lwrage
lwrage merged commit b4ff9f8 into master Sep 18, 2026
1 check passed
@lwrage
lwrage deleted the 2832_validate_modal_mode_mappings 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 ErrorStateToModeMapping.mappedModes

2 participants