Products and Services
Oracle Technology Network
If the key to be insterted into a HashMap is null and the table needs to be resized as part of the insertion then addEntry will try to recalculate the hash of a null key. This will fail with an NPE.
as per evaulation
use the same logic for calls to hash() as elsewhere:
hash = (null != key) ? hash(key) : 0;