@aescling assuming HashMap, that shouldn't be the difference: its hash code includes both keys and values. Also put calculates the hash of the key well before making any changes to the HashMap.
Tho it seems like whenever a resize triggers it will stack overflow for both the key and value cases for that reason.
also it would be impossible to reliably actually get a HashMap out of itself (since the hash it'll be stored under won't be true once it's stored).
@aescling assuming HashMap, that shouldn't be the difference: its hash code includes both keys and values. Also
put
calculates the hash of the key well before making any changes to the HashMap.Tho it seems like whenever a resize triggers it will stack overflow for both the key and value cases for that reason.
also it would be impossible to reliably actually get a HashMap out of itself (since the hash it'll be stored under won't be true once it's stored).