bito-code-review[bot] commented on PR #16160:
URL: https://github.com/apache/grails-core/pull/16160#issuecomment-5309503311
<!-- Bito Reply -->
The observation is correct. In the `handleConverterNotFoundException`
method, the code iterates over the raw map entries and uses the original `key`
object directly when putting it into the map-backed instance:
```groovy
((Map) instance).put(key, val)
```
If the `key` is not a `String` (e.g., a `GString`), this can lead to issues
where subsequent lookups using `String` keys fail, even though the code earlier
in the loop correctly normalizes the key to a `String` for property matching
(`String propertyName = key.toString()`). To ensure consistency and
compatibility with `String`-based lookups, the code should use the normalized
`propertyName` instead of the original `key` when populating the map.
**grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/ConfigurationBuilder.groovy**
```
if (mapBacked) {
((Map) instance).put(propertyName, val)
return
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]