myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Marinschek (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (MYFACES-1295) wrong Converter on Arraytypes
Date Wed, 20 Sep 2006 21:10:23 GMT
    [ http://issues.apache.org/jira/browse/MYFACES-1295?page=comments#action_12436349 ] 
            
Martin Marinschek commented on MYFACES-1295:
--------------------------------------------

Ok, I'll add a bit more to the discussion - the corresponding code is in _SharedRendererUtils;
it's about changing the following segment:

        // Now, we have a converter...
        // We determine the type of the component array after converting one of it's elements
        if (vb != null)
        {
            valueType = vb.getType(facesContext);
            if (valueType != null && valueType.isArray())
            {
                if (submittedValue.length > 0) 
                {
                    arrayComponentType = converter.getAsObject(facesContext, component, submittedValue[0]).getClass();
                }
            }
        }

I really wonder why we are doing this - we know the arrayComponentType already by saying valueType.getComponentType(),
why converting the first element and then taking this one?

regards,

Martin

> wrong Converter on Arraytypes
> -----------------------------
>
>                 Key: MYFACES-1295
>                 URL: http://issues.apache.org/jira/browse/MYFACES-1295
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>            Reporter: Richard van Nieuwenhoven
>            Priority: Minor
>
> the method getConvertedUISelectManyValue overwrites the arrayComponentType of the ValueBinding
with the type of the first converted value.
> This is not correct when i have an array of subclasses, the arrayComponentType of the
ValueBinding should have the highest priority.
> When there is a arrayComponentType of the ValueBinding whitch is not String or Object
it should not be overwritten by the type of the first element in the array.
> fix replace "if (vb != null)" with "if (vb != null && converter != null &&
arrayComponentType == null)"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message