Commit 1829d42
committed
Ask the collection branch the question its siblings already ask
Three places bind an element into a collection, and two of them keep the item
when the element type is already assignable from it: the array branch above and
the Map branch below both do it, and SimpleDataBinder does it too. Only the
collection branch went straight to instantiating, which is why a raw collection
lost its data there and nowhere else.
Asking the same question there fixes it in the same shape as its neighbours,
rather than adding a special case for Object, and needs no change to
instantiateAndBindNestedOrUseMapConstructor: a raw collection's component type
is Object, Object is assignable from everything, so the element is kept.
The SimpleDataBinder guard from the first commit is dropped with this: that
class already asks at line 373 and was never affected.1 parent 17d24ee commit 1829d42
2 files changed
Lines changed: 11 additions & 21 deletions
File tree
- grails-databinding-core/src/main/groovy/grails/databinding
- grails-web-databinding/src/main/groovy/grails/web/databinding
Lines changed: 0 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | 429 | | |
440 | 430 | | |
441 | 431 | | |
| |||
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
549 | 559 | | |
550 | 560 | | |
551 | 561 | | |
| |||
634 | 644 | | |
635 | 645 | | |
636 | 646 | | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
| |||
0 commit comments