edit: Pages 585 and 586 do talk about this, but what they talk about is slightly different because they use a new Dog object ( and not the reference to the existing Dog object on the heap)
d.name = "magnolia";
that is System.out.println(m.get(new Dog("clover")));
as opposed to
d.name = "magnolia";
System.out.println(m.get(d));
which have different meanings
---------------------------------------------
I was reading this
http://mindprod.com/jgloss/hashtable.html to understand more about HashMaps and Hashtables in java.
It appears that internally the Maps are rehashed when the load/capacity increases.
I guess at some unpredictable point (only when and if the load on the HashMap increases), the hash bucket for the key with d.name="magnolia" may change to correspond to 8, at that time the map would be able to return the value for this key.
But all this rehashing is unpredictable and only depends on the Map's load/capacity, it can't be relied upon, so it is not a good idea to change anything in the Map's key (object) after it has been inserted into the HashMap or Hashtable, because the value can't be retrieved in a predictable manner.