You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Richard van Nieuwenhoven (JIRA)" <de...@myfaces.apache.org> on 2006/05/02 11:22:46 UTC

[jira] Created: (MYFACES-1295) wrong Converter on Arraytypes

wrong Converter on Arraytypes 
------------------------------

         Key: MYFACES-1295
         URL: http://issues.apache.org/jira/browse/MYFACES-1295
     Project: MyFaces Core
        Type: Bug

    Versions: 1.1.0, 1.1.1, 1.1.3-SNAPSHOT, 1.1.2, 1.1.4-SNAPSHOT    
    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


[jira] Commented: (MYFACES-1295) wrong Converter on Arraytypes

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485354 ] 

Mike Kienenberger commented on MYFACES-1295:
--------------------------------------------

Removing patch available status -- no patch available in unified diff format after one year.

> wrong Converter on Arraytypes
> -----------------------------
>
>                 Key: MYFACES-1295
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1295
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>            Reporter: Richard van Nieuwenhoven
>         Assigned To: Martin Marinschek
>            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.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MYFACES-1295) wrong Converter on Arraytypes

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-1295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Kienenberger updated MYFACES-1295:
---------------------------------------

    Status: Open  (was: Patch Available)

> wrong Converter on Arraytypes
> -----------------------------
>
>                 Key: MYFACES-1295
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1295
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>            Reporter: Richard van Nieuwenhoven
>         Assigned To: Martin Marinschek
>            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.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MYFACES-1295) wrong Converter on Arraytypes

Posted by "Richard van Nieuwenhoven (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-1295?page=all ]

Richard van Nieuwenhoven updated MYFACES-1295:
----------------------------------------------

    Status: Patch Available  (was: Open)

> wrong Converter on Arraytypes
> -----------------------------
>
>          Key: MYFACES-1295
>          URL: http://issues.apache.org/jira/browse/MYFACES-1295
>      Project: MyFaces Core
>         Type: Bug

>     Versions: 1.1.0, 1.1.1, 1.1.3-SNAPSHOT, 1.1.2, 1.1.4-SNAPSHOT
>     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


[jira] Commented: (MYFACES-1295) wrong Converter on Arraytypes

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1295?page=comments#action_12377821 ] 

Mike Kienenberger commented on MYFACES-1295:
--------------------------------------------

This is a volunteer project.   There's only so much time to work on issues that don't directly impact us.   This is a minor issue that's only been open for two days.

One thing you can do to speed up the processing of your issue is submit it as a unified diff file attachment rather than as text in a comment.

Another thing you can do is provide an example that allows us to verify the behavior beforehand and the behavior afterward.

Other than that, you'll need to be patient.


> wrong Converter on Arraytypes
> -----------------------------
>
>          Key: MYFACES-1295
>          URL: http://issues.apache.org/jira/browse/MYFACES-1295
>      Project: MyFaces Core
>         Type: Bug

>     Versions: 1.1.0, 1.1.1, 1.1.3-SNAPSHOT, 1.1.2, 1.1.4-SNAPSHOT
>     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


[jira] Commented: (MYFACES-1295) wrong Converter on Arraytypes

Posted by "Richard van Nieuwenhoven (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-1295?page=comments#action_12377730 ] 

Richard van Nieuwenhoven commented on MYFACES-1295:
---------------------------------------------------

this bug was found in context of issue [TOBAGO-59]. This is important for me!!!. Could somebody apply my patch? or tell me why my patch is not correct? 
thanks
Ritchie


> wrong Converter on Arraytypes
> -----------------------------
>
>          Key: MYFACES-1295
>          URL: http://issues.apache.org/jira/browse/MYFACES-1295
>      Project: MyFaces Core
>         Type: Bug

>     Versions: 1.1.0, 1.1.1, 1.1.3-SNAPSHOT, 1.1.2, 1.1.4-SNAPSHOT
>     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


[jira] Commented: (MYFACES-1295) wrong Converter on Arraytypes

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ 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