[ 
https://issues.apache.org/jira/browse/WW-5535?focusedWorklogId=1006590&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1006590
 ]

ASF GitHub Bot logged work on WW-5535:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Feb/26 16:23
            Start Date: 22/Feb/26 16:23
    Worklog Time Spent: 10m 
      Work Description: sonarqubecloud[bot] commented on PR #1592:
URL: https://github.com/apache/struts/pull/1592#issuecomment-3941316727

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1592) 
**Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1592&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=1592&issueStatuses=ACCEPTED)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=1592&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [100.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1592&metric=new_coverage&view=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1592&metric=new_duplicated_lines_density&view=list)
  
     
   [See analysis details on SonarQube 
Cloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=1592)
   
   




Issue Time Tracking
-------------------

    Worklog Id:     (was: 1006590)
    Time Spent: 0.5h  (was: 20m)

> HttpMethodInterceptor does not work with action names using wildcards
> ---------------------------------------------------------------------
>
>                 Key: WW-5535
>                 URL: https://issues.apache.org/jira/browse/WW-5535
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 6.7.0, 7.0.0
>            Reporter: Riccardo Proserpio
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 6.9.0, 7.2.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The ActionProxy.isMethodSpecified() method is documented as:
> {noformat}
> Gets status of the method value's initialization.
> Returns: true if the method returned by getMethod() is not a default 
> initializer value.
> {noformat}
> However, the implementation in DefaultActionProxy has a different behavior:
>  
> {code:java}
> private void resolveMethod() {
>     // if the method is set to null, use the one from the configuration
>     // if the one from the configuration is also null, use "execute"
>     if (StringUtils.isEmpty(this.method)) {
>         this.method = config.getMethodName();
>         if (StringUtils.isEmpty(this.method)) {
>             this.method = ActionConfig.DEFAULT_METHOD;
>         }
>         methodSpecified = false;
>     }
> } {code}
> methodSpecified is set to false not only if the default value is used, but 
> also \{*}if methodName is specified via config{*}.
> This method seems to have been introduced long ago as a patch for some DMI 
> behavior regression: WW-3628
> The issue happens for example if you specify an action like
> {code:java}
> <action name="example-*" class="aClass" method="aMethod"/>
> {code}
> since the method value is resolved later by wildcard matching.
> The HttpMethodInterceptor uses isSpecifiedMethods to decide when to process 
> the invocation:
>  
> {code:java}
> if (invocation.getProxy().isMethodSpecified()) {
>     Method method = 
> action.getClass().getMethod(invocation.getProxy().getMethod()); 
>     // doIntercept...
> }{code}
> thus skipping the validation for actionNames with wildcards.
> I'm not really sure if isMethodSpecified is wrong or has misleading 
> documentation. I'm not even sure why the HttpMethodInterceptor should skip 
> validation on the default execute methods.
> A fix might be just assessing the existence of 
> invocation.getProxy().getMethod() instead on relying on isMethodSpecified, 
> but before submitting a pr I'd like the opinion on the maintainers.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to