You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Cagatay Civici (JIRA)" <de...@myfaces.apache.org> on 2006/10/14 14:07:35 UTC

[jira] Created: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than 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

        

[jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

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

        

[jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "Wendy Smoak (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=comments#action_12442662 ] 
            
Wendy Smoak commented on TOMAHAWK-738:
--------------------------------------

Author: schof
Date: Mon Oct 16 11:16:32 2006
New Revision: 464604

URL: http://svn.apache.org/viewvc?view=rev&rev=464604
Log:
Reverted most of Catagay's r464151 changes.  The original problem that he was trying to solve is really a problem with the MyFaces core not following the spec.  I also commented out a problematic test that does not currently pass b/c the core is broke.

> 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.4-SNAPSHOT
>            Reporter: Cagatay Civici
>         Assigned To: Cagatay Civici
>             Fix For: 1.1.4-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

        

[jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

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

        

[jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "sean schofield (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=comments#action_12443114 ] 
            
sean schofield commented on TOMAHAWK-738:
-----------------------------------------

Again, nobody is saying there's not a problem here its just this solution merely covers up a problem that exists in the implementation.  At a minimum we should check instanceof StateHolder on the restore call but it would be better (IMO) to address the root cause of the problem that prevents saveAttachedState to be called with List or whatever (as it clearly should be able to according to the HTML docs/spec.)

> 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

        

[jira] Resolved: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "Cagatay Civici (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=all ]

Cagatay Civici resolved TOMAHAWK-738.
-------------------------------------

    Resolution: Fixed

Now saveAttachedState is not used for non state holders

> 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

        

[jira] Reopened: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "sean schofield (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=all ]

sean schofield reopened TOMAHAWK-738:
-------------------------------------

             
Catagay this breaks my code.  Serializable should also be supported.  I have a bunch of Hibernate domain objects that are serializable that I use in a multi page table where I need save state.  

> 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

        

[jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=comments#action_12442699 ] 
            
Martin Marinschek commented on TOMAHAWK-738:
--------------------------------------------

Hi Sean,

I see what you're saying about coupling restore.../save... I don't see your point about lists in myfaces-core, though. We do have special list-handling code in there. Is this different in the RI?

regards,

Martin

> 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.4-SNAPSHOT
>            Reporter: Cagatay Civici
>         Assigned To: Cagatay Civici
>             Fix For: 1.1.4-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

        

[jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "sean schofield (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=comments#action_12442650 ] 
            
sean schofield commented on TOMAHAWK-738:
-----------------------------------------

I discovered the reason why Catagay's fix breaks my code.  By not calling saveAttachedState for Serializable objects that do not implement StateHolder you will get an exception with the 1.2 RI when calling restoreAttachedState.  You really shouldn't call one without the other.  The spec is a little unclear on this and mentions only that restoreAttachedState is "tightly coupled" with saveAttachedState and is meant to be called to restore objects that were saved with that method.  

The real problem is that the MyFaces core seems to have a spec compliance issue.  The original problem was that a List could not be saved and only a StateHolder could be used.  That clearly violates the spec which says:

"This method supports saving attached objects of the following type: Objects, null values, and Lists of these objects. If any contained objects are not Lists  and do not implement StateHolder, they must have zero-argument public constructors. The exact structure of the returned object is undefined and opaque, but will be serializable."

I suggest we create a new bug in the core project (with a category of JSF spec compat) and then mark this bug as Won't Fix as well as link it to the new bug.  Finally, I suggest we add a new unit test to the core to expose the bug and make it similar to Catagay's test case.  Ideally we also change Catagay's test case for UISaveState to use mocks to verify that save and restoreAttachedState are being called (suggest JMock).  You don't really want the test to pass depending on which version of the JSF implementation you use.

> 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.4-SNAPSHOT
>            Reporter: Cagatay Civici
>         Assigned To: Cagatay Civici
>             Fix For: 1.1.4-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

        

[jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "sean schofield (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=comments#action_12442661 ] 
            
sean schofield commented on TOMAHAWK-738:
-----------------------------------------

I undid the most of the changes from revision 464151.  I tried to create a suitable test alternative but I ran out of time.  Please fix your problem by addressing the core which is not following the spec in this regard.

> 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.4-SNAPSHOT
>            Reporter: Cagatay Civici
>         Assigned To: Cagatay Civici
>             Fix For: 1.1.4-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

        

[jira] Updated: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "Sylvain Vieujot (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=all ]

Sylvain Vieujot updated TOMAHAWK-738:
-------------------------------------

        Status: Resolved  (was: Patch Available)
    Resolution: Fixed
      Assignee: Sylvain Vieujot  (was: Cagatay Civici)

xed in rev 465098 by adding a parameter to be sure that rsaveAttachedState & restoreAttachedState are always used in conjonction.

> 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: Sylvain Vieujot
>             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

        

[jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "sean schofield (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=comments#action_12442929 ] 
            
sean schofield commented on TOMAHAWK-738:
-----------------------------------------

I was under the impression the original bug Catagay was trying to fix was that Lists were not being saved by UISaveState correctly.  My point is that they would be saved correctly if passed to saveAttachedState in UIComponentBase (at least if the spec were implemented properly.)  I'm assuming he had a problem b/c otherwise he would not have changed the code to check for StateHolder.  According to the spec, List<Serializable> should work with UIComponentBase saveAttachedState.  Make sense?  By the way, if this code is in Tomahawk 1.1.4 branch it needs to come out. ASAP.

> 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.4-SNAPSHOT
>            Reporter: Cagatay Civici
>         Assigned To: Cagatay Civici
>             Fix For: 1.1.4-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

        

[jira] Commented: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "sean schofield (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=comments#action_12442960 ] 
            
sean schofield commented on TOMAHAWK-738:
-----------------------------------------

Thanks for clarifying.  The only stuff I didn't revert was a testcase that passes under 1.1.4 code and another one that I commented out.  So I don't think anything needs to go to the branch at this point.

> 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

        

[jira] Updated: (TOMAHAWK-738) SaveState fails with a java.util.List implementation other than ArrayList

Posted by "Sylvain Vieujot (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-738?page=all ]

Sylvain Vieujot updated TOMAHAWK-738:
-------------------------------------

    Status: Patch Available  (was: Reopened)

> 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