You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Michael Simons <mi...@optitool.de> on 2009/11/17 15:58:58 UTC
collection null although initialized
Hello,
Given two classes like:
class A {
Set<B> members = new HashSet<B>(13); // We initialize the set
...
Map<String,String> getMembersMap() {
Map<String,String> m = new HashMap<String, String>(members.size()); // We get a NPE here!
...
return m;
}
}
class B {...}
Is this a known issue?
Do we have to always check for a null collection even if we initialized it?
kind regards,
Michael