codeconsole commented on PR #16282:
URL: https://github.com/apache/grails-core/pull/16282#issuecomment-5607379998
All four addressed, in `8581d5604f` (branch also synced with `8.0.x`):
**1. Neo4j regression** — took option (b): `rewrap` now gates on the
replaced value being one of the plugin's own generic wrapper classes by **exact
class**, not `instanceof` (`Neo4jList extends DirtyCheckingList`, so
`instanceof` was the trap). A store-specific wrapper or `PersistentCollection`
being replaced stores the raw value, and the store's persister re-wraps it on
save exactly as at merge-base. Added `HasManyReassignDirtyCheckingSpec` in
grails-data-neo4j (embedded harness, your exact reassign → save → remove → save
→ reload shape) — verified it fails with the previous `instanceof` gate and
passes with the exact-class one. There's also a unit spec pinning that a
`DirtyCheckingList` *subclass* as the old value is left alone.
**2. Map wrapper** — covered rather than documented away: overrides for the
`@Delegate`-generated default methods (`putIfAbsent`, `merge`, `compute*`,
`replace`, `replace(k,old,new)`, `replaceAll`, `remove(k,v)`), and
`entrySet()`/`keySet()`/`values()` now return tracking wrappers, which catches
Groovy's `Map.removeAll(Closure)`/`retainAll(Closure)` (entrySet iteration),
`keySet().remove(k)` and `values().removeIf { }`. `DirtyCheckingList.subList()`
returns a tracking view too. The one Map path left untracked is
`Map.Entry.setValue` during iteration — called out in the docs.
**3. SortedSet** — added to the transformer's rewrappable set, and both
`wrap()` and `rewrap()` now produce `DirtyCheckingSortedSet` ahead of the `Set`
check, so a `TreeSet` keeps its `SortedSet` API behind the wrapper (including
on `Set`-declared properties via `wrap()`).
**4. Docs** — rewrote the caveat paragraph in
`objectMapping/dirtyChecking.adoc`: reassignment now stays tracked, with the
remaining gaps listed explicitly — hand-written setters (weave-only, unchanged
in this PR), `Map.Entry.setValue`, and store-specific wrappers deliberately
left to their store's persister.
--
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]