-
Jan 26th, 2010, 01:56 PM
#1
SpEL and collections
For a class Foo that contains a list of Bar objects
class Foo
{
List<Bar> bars;
}
class Bar
{
String str;
}
and for an SpEL expression of bars[0].str and attempting to set the string value, I am getting an UnsupportedOperationException because SpEL is setting the collection to an emptyList (I assume through Collections.emptyList).
I have set the autoGrowCollections to true.
How would one create a Bar object through SpEL that will allow it to set the value of a property?
Thanks,
Brian
-
Jan 26th, 2010, 02:33 PM
#2
Ummm yeah
I looked at the source code and didn't find anything that would assign an empty list. I took a look at my source code and I was too cute. I initialized the value to an emptyList for another purpose.
In short, no problems here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules