mstahv/maddon — pull request #8 by jdryan1 (2014-04-02 22:07:27+00:00)
Title: ListContainer and empty backing list

The ListContainer(Collection) constructor is dangerous and perhaps should be deprecated. If the backing list is empty, an IndexOutOfBoundsException will be thrown in the getDynaClass method when properties are accessed. See the testEmptyList method I added to the DynaBeanBasedContainer test.

I added a (Class, Collection) constructor (ala BeanItemContainer) and made a slight mod to setCollection that allows the empty list to be the backing list rather than creating a new empty list (it surprised me, but isAssignableFrom appears to return false for empty lists).