To be honest, I'm not sure why entrySet()
seems to be returning null
for you, but the map initialization appears to be working for me, and looks pretty OK to me.
The problem is in map.get(i).put(j.getKey(), d);
, for the types of i
and j
you stated. You declared map
to be Map<Integer, Map<Integer, Float>>
, which means map
has Integer
keys and Map<Integer, Float>
values. Thus, when you call get(i)
with the key i
being Map.Entry<Integer, Point3f>
, map
can't find an entry corresponding to that particular key, so it returns null
. Then you get a NullPointerException
when you try to call put
on the map you thought you got.