Skip to content

WW-3464 test(config): pin first-match-wins wildcard order - #2004

Merged
lukaszlenart merged 1 commit into
mainfrom
WW-3464-wildcard-first-match-wins
Oct 10, 2026
Merged

lukaszlenart merged 1 commit into
mainfrom
WW-3464-wildcard-first-match-wins

Conversation

@lukaszlenart

Copy link
Copy Markdown
Member

Fixes WW-3464

Summary

The ticket reports that XML wildcard action mappings resolve to the first matching pattern, while the docs claim "the last one wins". The framework behaviour is correct and matches the AbstractMatcher / ActionConfigMatcher Javadoc; the documentation is wrong and is corrected in a companion struts-site PR.

This PR is test-only: it pins the first-match-wins rule end to end (XML → PackageConfig → RuntimeConfiguration → ActionConfigMatcher) using the ticket's own ** / Project** patterns in both declaration orders, so the behaviour cannot silently drift.

Verification

  • Both new tests pass on current main.
  • With AbstractMatcher.match() temporarily changed to last-match-wins (the break removed), both fail with the ticket's symptom (expected:<[execute]> but was:<[input]> and vice versa).
  • All other test classes loading xwork-sample.xml stay green, except DefaultFileManagerTest (jar/zip/wsjar URL handling), which fails identically on clean main.

Convention-plugin ordering (most-specific-first, WW-3784 / WW-5743) is a separate path and is not affected.

🤖 Generated with Claude Code

When several XML wildcard action names match a request, the first one
declared in the package wins. Cover both declaration orders with the
ticket's `**` / `Project**` patterns so the behaviour cannot drift from
what the documentation describes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@lukaszlenart
lukaszlenart marked this pull request as ready for review October 10, 2026 12:49
@lukaszlenart
lukaszlenart merged commit 6cbf4e7 into main Oct 10, 2026
16 checks passed
@lukaszlenart
lukaszlenart deleted the WW-3464-wildcard-first-match-wins branch October 10, 2026 14:03
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.

1 participant