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

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

                Author: ASF GitHub Bot
            Created on: 25/Jul/26 10:35
            Start Date: 25/Jul/26 10:35
    Worklog Time Spent: 10m 
      Work Description: sonarqubecloud[bot] commented on PR #1811:
URL: https://github.com/apache/struts/pull/1811#issuecomment-5078171913

   ## [![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=1811) 
**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=1811&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=1811&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=1811&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [88.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=1811&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=1811&metric=new_duplicated_lines_density&view=list)
  
     
   <!

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

    Worklog Id:     (was: 1032159)
    Time Spent: 50m  (was: 40m)

> Invalid cache key in AnnotationActionValidationManager.buildValidatorKey  
> when using visitor field validators
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3530
>                 URL: https://issues.apache.org/jira/browse/WW-3530
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.2.1
>            Reporter: Johnny Yu
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.3.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Error scenerio:
> MyAction-validation.xml:
> <validators>
>       <field name="myField"> <!-- MyClass -->
>               <field-validator type="visitor">
>                       <param name="context">basic</param>
>                       <param name="appendPrefix">true</param>
>                       <message/>
>               </field-validator>
>       </field>
>       <field name="myField">
>               <field-validator type="visitor">
>                       <param name="context">additional</param>
>                       <param name="appendPrefix">true</param>
>                       <message/>
>               </field-validator>
>       </field>
> </validators>
> In this case, validators in MyClass-basic-validation.xml will be executed two 
> times, but validators in MyClass-additional-validation.xml will just ignored.
> The problem is caused by 
> AnnotationActionValidationManager.buildValidatorKey(Class) which returns the 
> same cache key for the validator cache.
> The current cache key is created by:
> StringBuilder sb = new StringBuilder(clazz.getName());
> sb.append("/");
> sb.append(proxy.getConfig().getName());
> sb.append("|");
> sb.append(proxy.getMethod());
> The context is not a part of the cache key. Therefore, the two visitor 
> validator will just get the same cache key. 



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

Reply via email to