borinquenkid opened a new pull request, #16154: URL: https://github.com/apache/grails-core/pull/16154
## Summary - Replaces the 4-level `AbstractFinder -> DynamicFinder -> AbstractFindByFinder -> concrete finder` inheritance chain in `org.grails.datastore.gorm.finders` (grails-datamapping-core) and the parallel hierarchy in `org.grails.gorm.rx.finders` (grails-datamapping-rx) with flat classes configured via static factories, composing a shared `DynamicFinder`/`FinderGrammar` instead of extending it. - Fixes a confirmed dead-code bug in the old `FindOrSaveByFinder`: its own "construct from Equal expressions on null result" branch could never execute because the superclass (`FindOrCreateByFinder`) already performed construction-and-conditional-save before it. The new design has exactly one implementation of that logic (`SingleResultFinder#constructFromEqualExpressions`), shared by `findOrCreateBy`/`findOrSaveBy`, so this class of bug can't recur. - A TCK backend spot-check (`grails-datamapping-core-test`) caught a real regression introduced mid-refactor - a dropped `invoke(Class, String, DetachedCriteria, Object[])` overload needed by `AbstractDetachedCriteria#methodMissing`'s dynamic Groovy dispatch - which is fixed and covered by dedicated unit tests on all 6 affected classes (3 core, 3 rx). - Every other pre-existing behavior/quirk is preserved and re-asserted in tests rather than silently fixed, including: the And/Or literal-split collision, the empty-property-name-on-operator-collision crash, the sync/rx `findAllBy` `.distinct()` inconsistency, and rx's `findOrCreateBy`/`findOrSaveBy` missing the Or/comparison-operator validation the sync side has. - Follow-up commits address IntelliJ warnings surfaced across the touched classes (raw types, unused parameters/constructors turning out to be reflectively-used false positives, redundant conditions, a couple of small dedups), each verified against the full module test suites. ## Test plan - [x] `:grails-datamapping-core:test` - full suite green - [x] `:grails-datamapping-rx:test` - full suite green - [x] `:grails-datamapping-core-test:test` (TCK-backed, exercises real GORM dynamic-finder dispatch end-to-end) - full suite green - [x] `:grails-datamapping-core:codeStyle` / `:grails-datamapping-rx:codeStyle` - clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
