New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix testNullValuesFromMapLoaderAreNotInsertedIntoMap failure #26210
Conversation
…ap failure Fixes failure to throw a NullPointerException when a null value from a MapLoader is inserted into a Map. The issue appears to been have introduced in commit (#73b9460) in which the null value is chosen to be tolerated as normal rather then exceptional. fixes (hazelcast#26184)
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Internal PR hazelcast/hazelcast-mono#359 |
@alyokaz thanks for the pull request! @ahmetmircik can you please have a look? |
Just wanted to point out that the Refactor deals with null values being added by passing over them and not adding them to the map both when a key has a null value and in the case of a non-existent key. This is why the NPE wasn't being thrown, however, the fix will be over-zealous in the latter case and should probably be made conditional on the existence of the key if we want to allow for both behaviours. |
Thinking about this further, the fix does fulfil the IMap.loadAll() contract that an NPE should be thrown if any key or value returned by MapLoader.loadAll() is null. However, this might be considered inconsistent with the behaviour of get() witch returns null if the the key does not exist as opposed to throwing an NPE. getAll() calls loadAll() and so an NPE is thrown there as well. |
Hi, just have a look at this.
|
This pull request has been closed because it was already closed as https://github.com/hazelcast/hazelcast-mono/pull/359 |
Fixes failure to throw a
NullPointerException
when a null value from aMapLoader
is inserted into a Map.The issue appears to been have introduced in commit 7ec4749 in which the null value is chosen to be tolerated as normal rather then exceptional.
I've reused the code
DefaultRecordStore
as this was the check in the original flow of the code. ThepartitionId
check is superfluous here, however.Fixes #26184