[ 
https://issues.apache.org/struts/browse/WW-3154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46375#action_46375
 ] 

Wes Wannemacher commented on WW-3154:
-------------------------------------

IMO, the more important issue is - why is repopulateField being called when 
there are no conversion errors. A null-check would be an easy fix, but since 
it's the logging you want to get rid of, there is no good way to unit test. If 
I have some time I'll try to whip up a unit test to see if that method gets 
called inappropriately and then fix it. (BTW, this is an XWork class and this 
JIRA might get closed and moved to opensymphony)

> RepopulateConversionErrorFieldValidatorSupport logs a warning when 
> repopulating fields without conversion errors
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3154
>                 URL: https://issues.apache.org/struts/browse/WW-3154
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.2
>         Environment: Tomcat 6.0.18 on CentOS 4
>            Reporter: Lucas Nelson
>
> In RepopulateConversionErrorFieldValidatorSupport at line 176 (in the 2.1.2 
> version at least), a warning is logged on any field that does not have a 
> conversion error.
> The call to "conversionErrors.get(fullFieldName)" returns null when there was 
> no errors, and therefore the result of that call fails to match the 
> instanceof checks, falling through to the else clause and logging the error.
> There should be no log message when there is no conversion error as the 
> repopulate function has nothing it needs to do in that case. I would suggest 
> a "conversionErrors.contains(fullFieldName)" prior to doing anything in that 
> method. Or, change the validate() method to test for that before calling the 
> repopulateField() method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to