Cache implementations should have consistent behavior regarding null keys


It appears that various implementations of Cache have different behavior, regarding null keys (DefaultCache allows them, while the Hazelcast-backed cache does not).

Behavior should be consistent (and documented).




Daryl Herzmann
December 12, 2016, 3:17 PM

Setting this to a blocker as it is something that needs straightened out/resolved prior to release.

Tom Evans
August 15, 2016, 7:35 PM

Perhaps emitting a warning log message would be preferable to throwing an exception. Specifically it would be helpful to know which caches are using this currently undocumented "feature" and for what purpose.

In addition, the modified behavior should be configurable via system property (e.g. allowNullCacheKeys = true|false).

Guus der Kinderen
August 12, 2016, 7:14 PM

This fix introduced instability, as discussed in the original pull request:

I've created a PR to revert the original change here:

As far as I'm concerned, a change similar to this is still desirable. We should revisit the proposed solution.



Dave Cridland


Guus der Kinderen