Hello, @poutsma I current use version is org.springframework:spring-core:5.3.8

When I used JdbcTemplate::queryForList(sql) found that, LinkedCaseInsensitiveMap::getOrDefault throw NullPointerException, This is obviously not the expected value OrDefault. WeChat0ac08d2ab6eead3f082434db1039d370

Comment From: bclozel

It's not clear whether you're reporting an issue for JdbcTemplate, LinkedCaseInsensitiveMap or an issue with your auto-configuration setup. Could you share a minimal application that demonstrates the issue? If the problem is about LinkedCaseInsensitiveMap, a simple code snippet explaining the behavior you'd expect and what you're seeing instead would be enough.

Screen captures are hard to work with - in this case we have no clue about the schema variable, its state or where it comes from.

Comment From: mdeinum

I would argue that it works as designed... The key executeSchema key is present with a value of null. The default will only be returned if the key doesn't exist in the map, however as it exists the default won't apply. This is in accordance with the documentation on getOrDefault in the Map interface.

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.

Comment From: SortfGrowingup

Sorry, I misunderstood the meaning of the api itself... Thanks for @mdeinum explanation. As you said, The map#key exists, because the wrong api is used, resulting in the getOrDefault#toString throw NullPointerException