Hi again,

I forgot to mention why I would like to change that. It has two reasons:

- Performance: All instances instantly create lots of ArrayLists and only
very few of them are filled with elements.
- Consistency: Sometimes I see my unit-tests not discovering
NullPointerExceptions because I created the testdata by directly
instantiating the objects. So in the testcase all collections are set up,
but in my application (where I load XMLs) the collections are null,
therefore causing NPEs.


And the reason for making the CollectionMethodsDecorator-methods null-safe
is just lazyness :-)

cheers,
Christian


On Tue, Apr 9, 2013 at 1:22 PM, horschi <hors...@gmail.com> wrote:

> Hi,
>
> If I parse a XML file, all the collections that do not have elements, are
> not initialized. So far so is good.
>
> When I create one of my objects from java, then all the collections are
> initialized with a ArrayList. Which is not something I want.
>
> I am wondering if it is possible to tell jibx codegen to initialize all
> collections not with a ArrayList but with a null value. I tried to set the
> listClass of the ListImplementationDecorator to null, but it did not allow
> that. Is there a way to do so? If not, would it make sense to implement
> this?
>
>
> Also I think it would be nice if the CollectionMethodsDecorator would
> check for null-collections. Currently calling add() for a null collections
> causes a NullPointerException. Am I missing something here too?
>
>
> Thanks in advance for any advice. I'd be glad to create a Jira-Ticket (or
> two?) if this is something new.
>
> kind regards,
> Christian
>
>
>
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to