[ 
http://issues.apache.org/jira/browse/TOMAHAWK-738?page=comments#action_12443067 
] 
            
Sylvain Vieujot commented on TOMAHAWK-738:
------------------------------------------

I agree with Cagatay here.
In our applications we heavily rely on the savestate tag so save objects.
When those objects implement List, we get back an ArrayList.
If the original object was a LinkedList or a Stack, when they are restored, you 
get all kind of exceptions (either class casts or method not found, like poll, 
pop, ...).

I don't see how the spec would prevent the user to get back an object of the 
same class as the original one. Even if that object implements List.
Changing the type of a saved object is a bug, so I think we should put back 
Cagatay's fix.

> 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

        

Reply via email to