[hibernate-dev] Re: Regarding lazy initialization of ArrayList

"Nathan Xu" <[email protected]>
Newsgroups gmane.comp.java.hibernate.devel
Message-ID <[email protected]>
Thanks for the null-check tip! I appreciate that.

As a matter of fact, NPE issue still bothers us a lot. This recent PR from the community is another validation: https://github.com/hibernate/hibernate-orm/pull/3499How to systematically combat NPE is a good topic and still highly relevant. Maybe we can talk about it later.

I didn't anticipate we should abandon the 'lazy initialization' pattern totally (even when we limited its scope to ArrayList constructed by default constructor). My point is to raise the awareness that  since JDK7, ArrayList has a lazy-initialization feature built-in already. We still pay the cost to create an empty ArrayList (without allocating 10 elements in advance), but the overhead might be worthwhile for it leads to a more elegant and maintainable codebase.
_______________________________________________
hibernate-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.