-
Notifications
You must be signed in to change notification settings - Fork 37.7k
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
LinkedCaseInsensitiveMap#putIfAbsent does not honor the case where the key is associated with a null value #26868
Labels
Milestone
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged or decided on
label
Apr 27, 2021
sbrannen
added
the
in: core
Issues in core modules (aop, beans, core, context, expression)
label
Apr 27, 2021
poutsma
added
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged or decided on
labels
Apr 30, 2021
I suppose the same check is also necessary in the |
Looks like that method has the same contract, so I'll fix that one as well. |
Zoran0104
pushed a commit
to Zoran0104/spring-framework
that referenced
this issue
Aug 20, 2021
This commit makes sure that LinkedCaseInsensitiveMap::putIfAbsent honors the contract of the method, and also replaces the old entry if that mapped to null. Closes spring-projectsgh-26868
Zoran0104
pushed a commit
to Zoran0104/spring-framework
that referenced
this issue
Aug 20, 2021
This commit makes sure that LinkedCaseInsensitiveMap::computeIfAbsent honors the contract of the method, and also replaces the old entry if that mapped to null. Closes spring-projectsgh-26868
lxbzmy
pushed a commit
to lxbzmy/spring-framework
that referenced
this issue
Mar 26, 2022
This commit makes sure that LinkedCaseInsensitiveMap::putIfAbsent honors the contract of the method, and also replaces the old entry if that mapped to null. Closes spring-projectsgh-26868
lxbzmy
pushed a commit
to lxbzmy/spring-framework
that referenced
this issue
Mar 26, 2022
This commit makes sure that LinkedCaseInsensitiveMap::computeIfAbsent honors the contract of the method, and also replaces the old entry if that mapped to null. Closes spring-projectsgh-26868
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems to be a bug that
LinkedCaseInsensitiveMap#putIfAbsent
does not honor the case where the key is associated with anull
value.Here is the javadoc inherited from
java.util.Map
.Here is the code showing the difference with the normal map:
Output:
According to the javadoc it should return
null
and make the change, but the code only returnsnull
. The line:return this.targetMap.get(oldKey)
.The implementation:
Spring version: 5.3.5
The text was updated successfully, but these errors were encountered: