You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems to be a bug that LinkedCaseInsensitiveMap#putIfAbsent does not honor the case where the key is associated with a null value.
Here is the javadoc inherited from java.util.Map.
If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.
Here is the code showing the difference with the normal map:
This commit makes sure that LinkedCaseInsensitiveMap::putIfAbsent honors
the contract of the method, and also replaces the old entry if that
mapped to null.
Closesspring-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.
Closesspring-projectsgh-26868
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: