Hello
I ran into this really awkward problem in Map.get() (implemented as HashMap proxied by PersistentMap).
I am calling myMap.get(myKey) but always get
null, and myMap.keySet().contains(myKey) also returns
false, although myKey is contained in it!
I inspected myMap to see if it contains myKey and indeed it is, and it is mapped to a non-null value. I could easily prove it by iterating over the Map:
Code:
public void myCheck() {
for (MyKey k : myMap.keySet()) {
System.out.println(myMap.containsKey(k));
}
}
Although the loop is indeed entered for every k, myMap.contains(k) is never true. the result for my 2-keyed map is:
false
false
even
myMap.containsKey(myMap.keySet().iterator().next()) returns false.
How is this even possible?
Perhaps it is a PersistentMap bug?
Please help
Yuval