struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (Assigned) (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (WW-3762) XWorkBasicConverter doConvertToCollection causes ClassCastException if an item cannot be converted
Date Wed, 22 Feb 2012 12:31:52 GMT

     [ https://issues.apache.org/jira/browse/WW-3762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lukasz Lenart reassigned WW-3762:
---------------------------------

    Assignee: Lukasz Lenart
    
> XWorkBasicConverter doConvertToCollection causes ClassCastException if an item cannot
be converted
> --------------------------------------------------------------------------------------------------
>
>                 Key: WW-3762
>                 URL: https://issues.apache.org/jira/browse/WW-3762
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Value Stack
>    Affects Versions: 2.3.1.2
>            Reporter: Pelladi Gabor
>            Assignee: Lukasz Lenart
>              Labels: patch
>             Fix For: 2.3.2
>
>         Attachments: WW-3762.diff, example.txt
>
>
> My action has a property of type List<Integer> (same for other non-string types).
The action will later iterate over this property, and it gets a ClassCastException, because
the list (of type List<Integer>) contains a String.
> It is because XWorkBasicConverter.doConvertToCollection() converts the input string array
into an integer list. But if the input coming from the browser contains a value that cannot
be converted to a string, then the string "ognl.NoConversionPossible" is put into the list.
It is wrong, we should pay attention to the type of the list.
> I have attached a patch that does not put elements into the list that cannot be converted.
> I have also attached a file that contains a simple example for this bug.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message