myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Starets <max.star...@oracle.com>
Subject Re: [Trinidad] Coding error (a bug) in StampState.restoreChildStampState(StampState.java:201)
Date Mon, 21 Jun 2010 17:08:40 GMT
Dmitry,

We need to figure out what is going on first.
Are you modifying components within table dynamically?

Since the same components are being stamped for each row, it is expected 
that the component
set does not change when each row is decoded or rendered.

Regards,
Max Starets

Dmitry Barsukov wrote:
> Hi All,
>
> org.apache.myfaces.trinidad.component.StampState.restoreChildStampState(StampState.java:201)
>
> 201:    Object[] state = (Object[]) stampState;
>
> stampState is not an array when casted to an array. The rest of code 
> works with the array "state".
>
> The line above is causing me the exception.
>
> It seems that this line should be replaced by:
>
>    Object state[] = new Object[1];
>    if (stampState.getClass().isArray())
>        state = (Object[]) stampState;
>    else
>        state[0] = stampState;
>
> Please find the patch attached. Someone may have a better idea how to 
> fix the issue.
>
> My apologies to Trinidad community for not being able to rectify 
> the defect. It just disappears for unknown reason on the way when I am 
> trying to rectify it.
>
> Caused by: java.lang.ClassCastException: Class cannot be casted to array
>         at 
> org.apache.myfaces.trinidad.component.StampState.restoreChildStampState(StampState.java:201)
>         at 
> org.apache.myfaces.trinidad.component.UIXTable.restoreStampState(UIXTable.java:426)
>         at 
> org.apache.myfaces.trinidad.component.UIXCollection._restoreStampState(UIXCollection.java:1813)
>         at 
> org.apache.myfaces.trinidad.component.UIXCollection.postRowDataChange(UIXCollection.java:809)
>         at 
> org.apache.myfaces.trinidad.component.UIXCollection.setRowIndex(UIXCollection.java:505)
>         at 
> org.apache.myfaces.trinidad.component.UIXTable._processStamps(UIXTable.java:517)
>         at 
> org.apache.myfaces.trinidad.component.UIXTable.processFacetsAndChildren(UIXTable.java:374)
>         at 
> org.apache.myfaces.trinidad.component.UIXCollection.decodeChildrenImpl(UIXCollection.java:202)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1062)
>         at 
> org.apache.myfaces.trinidad.component.UIXCollection.processDecodes(UIXCollection.java:196)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1076)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1062)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:888)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1076)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1062)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:888)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1076)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1062)
>         at 
> org.apache.myfaces.trinidad.component.UIXForm.processDecodes(UIXForm.java:75)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1076)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1062)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:888)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:1076)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:1062)
>         at 
> org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:888)
>         at 
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:705)
>         at javax.faces.component.UIViewRoot.access$001(UIViewRoot.java:62)
>         at javax.faces.component.UIViewRoot$1.process(UIViewRoot.java:121)
>         at javax.faces.component.UIViewRoot.process(UIViewRoot.java:260)
>         at 
> javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:117)
>         at 
> org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:32)
>         at 
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
>         at 
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
>         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:178)
>         ... 22 more
> ---
> Sincerely yours
> Dmitry Barsukov


Mime
View raw message