[
https://issues.apache.org/jira/browse/WW-5743?focusedWorklogId=1042236&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1042236
]
ASF GitHub Bot logged work on WW-5743:
--------------------------------------
Author: ASF GitHub Bot
Created on: 17/Sep/26 06:51
Start Date: 17/Sep/26 06:51
Worklog Time Spent: 10m
Work Description: asf-ci commented on PR #340:
URL: https://github.com/apache/struts-site/pull/340#issuecomment-5710280558
Staged site is ready at https://struts.staged.apache.org/
Issue Time Tracking
-------------------
Worklog Id: (was: 1042236)
Time Spent: 40m (was: 0.5h)
> ActionNameSpecificityComparator can rank a broad ** pattern ahead of a
> narrower */* one
> ---------------------------------------------------------------------------------------
>
> Key: WW-5743
> URL: https://issues.apache.org/jira/browse/WW-5743
> Project: Struts 2
> Issue Type: Improvement
> Components: Plugin - Convention
> Reporter: Lukasz Lenart
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 7.4.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Follow-up to WW-3784 (7.3.0), which introduced
> {{ActionNameSpecificityComparator}} in the Convention plugin so annotated
> wildcard actions are matched most-specific-first instead of in class-scan
> order.
> The comparator's keys, in order, are: fewer wildcard tokens first, more
> literal characters first, fewer path-spanning {{\*\*}} tokens first, then
> lexical. Because the raw token count comes before the {{\*\*}} count, a
> pattern with one {{\*\*}} outranks a pattern with two {{\*}} even though
> {{\*\*}} crosses {{/}} and {{\*}} does not ({{WildcardHelper}} MATCH\_PATH vs
> MATCH\_FILE) — so {{\*\*}} is the broader pattern of the two and should lose:
> * {{a/\*\*}} — 1 wildcard token, 1 path-spanning
> * {{a/\*/\*}} — 2 wildcard tokens, 0 path-spanning
> Today the first sorts ahead of the second and shadows it for {{a/x/y}}.
> Proposed refinement: lift the {{**}}-count key above the raw token-count key
> (fewer {{\*\*}} first, then fewer tokens, then more literals). Ordering stays
> per-package by design. Worth a test pair in
> {{ActionNameSpecificityComparatorTest}} for exactly the {{a/\*\*}} vs
> {{a/\*/\*}} case, plus the {{\{var\}}} equivalent for
> {{NamedVariablePatternMatcher}} users.
> Fix version intentionally left unset.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)