[ https://issues.apache.org/struts/browse/STR-3081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Benedict resolved STR-3081. -------------------------------- Resolution: Fixed > Uploading a File using LazyDynaBean causes ClassCastException > ------------------------------------------------------------- > > Key: STR-3081 > URL: https://issues.apache.org/struts/browse/STR-3081 > Project: Struts 1 > Issue Type: Bug > Components: Core > Affects Versions: 1.3.9 > Reporter: Niall Pemberton > Assignee: Niall Pemberton > Fix For: 1.3.10 > > > The changes to RequestUtils associated with STR-487 cause my application to > throw "java.lang.ClassCastException: java.util.ArrayList" > http://svn.apache.org/viewvc?view=rev&revision=524895 > I use LazyDynaBean which returns Object.class as the property type of any > property which is not defined (since null would indicate no property and one > of the "lazy" features is to add properties automatically on "set"). Theres a > bug in the changes for r524895 which is using the Class's isAssignableFrom() > method the wrong way round: > propertyType.isAssignableFrom(List.class) > The above will return "true" when propertyType is "Object.class" - and so a > List is created which my application is not expecting (it expects a > FormFile). I believe the above will also fail if the property type is an > ArrayList which is also not desirable - correct code should be: > List.class.isAssignableFrom(propertyType) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.