You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lucas Nelson (JIRA)" <ji...@apache.org> on 2009/06/12 05:37:43 UTC

[jira] Created: (WW-3154) RepopulateConversionErrorFieldValidatorSupport logs a warning when repopulating fields without conversion errors

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.


[jira] Resolved: (WW-3154) RepopulateConversionErrorFieldValidatorSupport logs a warning when repopulating fields without conversion errors

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-3154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso resolved WW-3154.
---------------------------------

    Resolution: Fixed

fixed in xwork trunk. The code will now check if the field is in the conversion errors

> 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
>             Fix For: 2.1.8
>
>
> 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.


[jira] Commented: (WW-3154) RepopulateConversionErrorFieldValidatorSupport logs a warning when repopulating fields without conversion errors

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Updated: (WW-3154) RepopulateConversionErrorFieldValidatorSupport logs a warning when repopulating fields without conversion errors

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-3154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes Wannemacher updated WW-3154:
--------------------------------

    Fix Version/s: 2.1.8

bumping to 2.1.8, I don't have time to do this right now, will do it later.

> 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
>             Fix For: 2.1.8
>
>
> 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.