myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cagatay Civici (JIRA)" <...@myfaces.apache.org>
Subject [jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList
Date Tue, 17 Oct 2006 16:42:37 GMT
    [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=comments#action_12442971 ] 
            
Cagatay Civici commented on TOMAHAWK-738:
-----------------------------------------

My problem is saveAttachedState and restoreAttached methods use ArrayLists to wrap the List
implementation being passed(Same in RI). So when the list restored it's always an arraylist,
not the List implementation type that is saved. This causes argument exception during setting
the value via a valuebinding. Check out the example I've posted in the issue description.
It expects a LinkedList but it's actually called with an arraylist.

> SaveState fails with a java.util.List implementation other than ArrayList
> -------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-738
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-738
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: UISaveState
>    Affects Versions: 1.1.5-SNAPSHOT
>            Reporter: Cagatay Civici
>         Assigned To: Cagatay Civici
>             Fix For: 1.1.5-SNAPSHOT
>
>
> restoreAttachedState of UIComponentBase wraps the lists as an ArrayList so restoring
values fails when a list implementation other than an arraylist is used.
> An example;
>         private LinkedList list;
> 	private String name;
> 	private String surname;
> 	public LinkedList getList() {
> 		list = new LinkedList();
> 		list.add(name);
> 		list.add(surname);
> 		return list;
> 	}
> 	public void setList(LinkedList list) {
> 		name = (String)list.get(0);
> 		surname = (String)list.get(1);
> 	}

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