openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Simons <michael.sim...@optitool.de>
Subject collection null although initialized
Date Tue, 17 Nov 2009 14:58:58 GMT
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

Mime
View raw message