Weak Key based tables are asking for hashCode (original) (raw)
We are creating a table
Caffeine.newBuilder().maximumSize(N).weakKeys().build();
The keys placed into such a table might not have a valid hashCode always or it's an expensive hashCode to compute.
The expectation is that we do NOT need hashCode on the key because the entire map would based based on == (JVM reference equality)
However, during Maintenace phase of BoundedLocalCache$PerformCleanupTask
FrequencySketch.increment tries to call hashCode() on the key.
This seems like an obvious bug.
We are on the latest version.