codeconsole commented on PR #16282: URL: https://github.com/apache/grails-core/pull/16282#issuecomment-5651032904
Thanks — all five taken, one commit each. **Medium, `hasMany` re-init (`0ae70cef89`).** Took option 1. Reproducing it first was worth it: my initial probe passed, because saving the board without ever setting `members` stores no field at all and it decodes as `null`, not an empty `PersistentList`. With `members: []` actually stored it reproduces exactly as you described — decoded `PersistentList` → `java.util.ArrayList` after the re-init, assignment equality-suppressed, add untracked, `0` members on reload. `PersistentList`/`PersistentSet`/`PersistentSortedSet` now count as tracked in the old-value gate, by exact class, so the Neo4j subclasses still fail it. The gate reads only `getClass()`, never the contents, so an uninitialised lazy association is not forced. `HasManyReassignDirtyTrackingSpec` covers it next to the embedded one — verified red without the change. The docs now say the reassignment behaviour covers associations too, rather than leaving the caveat to the borrowed-collection paragraph. **Low, reflexive `equals` (`f799282454`).** Identity short-circuit before delegating, exactly as you wrote it. Spec pins `values()` and a `DirtyCheckingCollection` over an `ArrayDeque` — both fail without it, and `[wrapper].contains(wrapper)` was the assertion that actually caught it, since Groovy `==` does not. **Low, encoder nesting (`a7f7edb0d6`).** Fixed rather than deferred — it is one missing overload. `DirtyCheckingSupport.wrap` now has a `Map` form with the same already-wrapped guard as the `Collection` form, and the map branch routes through it. Kept as its own commit so it can be dropped if you would rather it were a separate PR. The unwrap loop in `genericWrapperTarget` stays, since it is what makes `rewrap` correct against any encoder. **Nit, redundant `iterator()` overrides (`2dade74084`).** Removed on all three subclasses. Confirmed the way you described: the iterator-removal and `removeAll(Closure)` specs on `List`, `Set` and `SortedSet` still pass without them, so the inherited one was doing the work. **Nit, docs `addFirst`/`addLast`.** Attached to `List` properties only; the removals and views stay on both. -- 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]
