myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Marinschek (JIRA)" <myfaces-...@incubator.apache.org>
Subject [jira] Commented: (MYFACES-715) ArrayStoreException in _SharedRendererUtils.getConvertedUISelectManyValue()
Date Thu, 20 Oct 2005 14:31:34 GMT
    [ http://issues.apache.org/jira/browse/MYFACES-715?page=comments#action_12332595 ] 

Martin Marinschek commented on MYFACES-715:
-------------------------------------------

I did not use your patch - there is a reason in using the arrayComponentType to create the
Array whenever possible.

So what was wrong was using Object[].class instead of Object.class for the array creation.

regards,

Martin

> ArrayStoreException in _SharedRendererUtils.getConvertedUISelectManyValue()
> ---------------------------------------------------------------------------
>
>          Key: MYFACES-715
>          URL: http://issues.apache.org/jira/browse/MYFACES-715
>      Project: MyFaces
>         Type: Bug
>   Components: Implementation
>     Versions: Nightly
>  Environment: JBoss 4, Windows XP, MyFaces nightly build for 20051016
>     Reporter: Ampie Barnard
>     Assignee: Martin Marinschek
>      Fix For: Nightly

>
> I get the following exception when submitting values for a UISelectMany:
> java.lang.ArrayStoreException: businesssaver.segment.Segment
> 	at org.apache.myfaces.renderkit._SharedRendererUtils.getConvertedUISelectManyValue(_SharedRendererUtils.java:148)
> 	at org.apache.myfaces.renderkit.RendererUtils.getConvertedUISelectManyValue(RendererUtils.java:680)
> 	at org.apache.myfaces.renderkit.html.HtmlListboxRendererBase.getConvertedValue(HtmlListboxRendererBase.java:127)
> 	at javax.faces.component.UISelectMany.getConvertedValue(UISelectMany.java:344)
> 	at javax.faces.component.UIInput.validate(UIInput.java:265)
> 	at javax.faces.component.UISelectMany.validate(UISelectMany.java:333)
> After further inspection, the following two lines seem to be the culprit. 
> Line 144:
>             Object [] convertedValues = (Object []) Array.newInstance(
>                     arrayComponentType==null?Object[].class:arrayComponentType,len);
> They result in the creation of an array of arrays of objects - Object[][], resulting
in an incorrect assignment 
> of an object where an array of objects is expected:
> Line 148:
>                 convertedValues[i]
>                     = converter.getAsObject(facesContext, component, submittedValue[i]);
> I apologise for not sending a patch, but unfortunately our co's firewall does not allow
me checkout from CVS

-- 
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