Closed arunthirupathi closed 3 years ago
That's the current approach—you must be able to handle null. People is interested in having a completely customized equality concept, which includes using null for representing an equivalence class of objects.
Thanks, no worries.
I am trying to upgrade fastutil from 6.5.9 version to 8.5.2 in Presto (Open source query engine, that has connector to lot of databases).
During the upgrade all of the Strategy equals method is raising NPE, because the Strategy is used for null check. The collections can't contain null from the application, so the strategy does not handle nulls.
Why is the Strategy used for null check ? wouldn't it be simpler to do if (k == null) instead of if ( this.strategy.equals(k, (Object) null)) ?