Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upLinkedCaseInsensitiveMap doesn't implement getOrDefault properly [SPR-13981] #18553
Comments
This comment has been minimized.
This comment has been minimized.
Martin Macko commented I've submitted a PR, that fixes this. |
This comment has been minimized.
This comment has been minimized.
Juergen Hoeller commented Thanks for the report and the pull request, guys! Fixed as part of a slightly wider revision of that class, also handling stored Juergen |
This was referenced Jan 11, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alexey Pomelov opened SPR-13981 and commented
The default
getOrDefault
method implemented in thejava.util.Map
interface uses onlyget
andcontainsKey
methods. Within theLinkedCaseInsensitiveMap
class these methods work with special form of keys. ButgetOrDefault
method is overriden also inHashMap
andLinkedHashMap
and it calculates hashes for keys itself.As a result can get this behavior.
Assuming select a single row via jdbc template with the column
IS_SINGLE=Y
Here are results of some method calls to the resulting map:
Affects: 4.2.4
Issue Links: