Announcement Announcement Module
Collapse
No announcement yet.
SpEL and collections Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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.

    Comment

    Working...
    X