Repository navigation
Conversation
Signed-off-by: Swapnil kachare <swapnilkachare03@gmail.com>
sbrannen
approved these changes
Nov 21, 2026
Member
There was a problem hiding this comment.
Good catch, and thanks for the PR!
In the future, please do not add additional blank lines.
Also, PRs like this require a test or tests that fail before the changes and pass after the changes. Note, however, that I will add those tests after merging.
In addition, please note that the commit needs a "body". See our contributing guidelines for examples.
LinkedCaseInsensitiveMap.KeySet.remove() for null values
sbrannen
approved these changes
Nov 21, 2026
…nsensitiveMap.java Signed-off-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
…nsensitiveMap.java Signed-off-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
sbrannen
added a commit
that referenced
this pull request
Nov 21, 2026
sbrannen
pushed a commit
that referenced
this pull request
Nov 21, 2026
Fix LinkedCaseInsensitiveMap.KeySet.remove() for null values Prior to this commit, LinkedCaseInsensitiveMap.KeySet.remove() returned false for a key mapped to a null value, even though the entry was removed. This is because it relied on the return value of LinkedCaseInsensitiveMap.remove(), which is null for both an absent key and a key mapped to null. This commit therefore checks whether the key is present before removing the entry, which also corrects the return value of keySet().removeAll() in such cases. Closes gh-37737 Signed-off-by: Swapnil kachare <swapnilkachare03@gmail.com> (cherry picked from commit 9d3ca11)
Member
|
Congratulations on submitting your first PR for the Spring Framework! 👍 This has been merged into Thanks |
Contributor
Author
|
Hi Sam Brannen sir,
Thank you for taking the time to review and merge my pull request (PR
#37737) in [spring-projects/spring-framework]. I really appreciate your
feedback and guidance throughout the process.
I enjoyed working on this and look forward to
contributing more to the project in the future.
Best regards,
Swapnil Kachare.
…On Sat, Nov 21, 2026, 7:51 PM Sam Brannen ***@***.***> wrote:
***@***.**** approved this pull request.
Good catch, and thanks for the PR!
In the future, please do not add additional blank lines.
Also, PRs like this require a test or tests that fail before the changes
and pass after the changes. Note, however, that I will add those tests
after merging.
—
Reply to this email directly, view it on GitHub
<#37737?email_source=notifications&email_token=A2OG53SE6OQGF6PSQOWISYT52GQHZA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMBQGU4DSMBXHAZ2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-6005890783>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2OG53XLVSFTJRQFLDZ3FWD52GQHZAVCNFSNUABDKJSXA33TNF2G64TZHMYTCNBYG42TGO2JONZXKZJ3GY2TEOBYHE2DKOBTUF3AE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/A2OG53TUIOEEDCEQQFA2TAT52GQHZA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMBQGU4DSMBXHAZ2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/A2OG53UNVPO2QCM2TWCQJTL52GQHZA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMBQGU4DSMBXHAZ2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
LinkedCaseInsensitiveMap.KeySet.remove(Object)so that removing an existing key mapped to anullvalue returnstrueinstead offalse.Cause
Previously,
KeySet.remove(Object)checkedLinkedCaseInsensitiveMap.this.remove(o) != null. BecauseMap.remove(key)returnsnullboth when a key is missing and when it is present with anullvalue, removing an existing key with anullvalue returnedfalse.Fix
containsKey(o)before removing the entry viaLinkedCaseInsensitiveMap.this.remove(o)and returntruewhen present (falseotherwise).Verification
./gradlew :spring-core:test --tests "*LinkedCaseInsensitiveMapTests*"locally.