rmorrise opened a new issue, #14607:
URL: https://github.com/apache/grails-core/issues/14607
### Task List
- [x] Steps to reproduce provided
- [x] Stacktrace (if present) provided
- [x] Example that reproduces the problem uploaded to Github
- [x] Full description of the issue provided (see below)
### Steps to Reproduce
1. Start with the previous example (linked below)
2. On the `Detail` domain class, add a class-level annotation:
`@BindUsing(DetailBindHelper)`
3. Create a `DetailBindHelper` class that returns: `new
FooDetail(fooProperty: source['fooProperty'])`
4. POST to /master with the following data:
```
{
"details": [
{"detailType": "FOO", "fooProperty": "foo"}
]
}
```
### Expected Behaviour
`BindingHelper#getPropertyValue()` should be invoked only once for each
child object converted. The object returned from this method should be added to
the collection on the parent object.
### Actual Behaviour
`BindingHelper#getPropertyValue()` seems to be invoked twice for each child
object in the input.
The object returned from this method is never used in the calling code.
See: `SimpleDataBinder#convert(Class, value)`, lines 782-784
The conversion result ends up being a blank object.
### Environment Information
- **Operating System**: Win7 x64
- **GORM Version:** 6.1.6.RELEASE
- **Grails Version (if using Grails):** 3.3.0
- **JDK Version:** 1.8.0_131
### Example Application
-
[https://github.com/rmorrise/bindToSubclassExample](https://github.com/rmorrise/bindToSubclassExample)
--
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]