The GitHub Actions job "Code Analysis" on 
grails-core.git/chore/cleanup-AbstractDetachedCriteria has succeeded.
Run started by GitHub user borinquenkid (triggered by borinquenkid).

Head commit for run:
cd40c6c164c09e74310efb08dc353a08577b74c5 / Walter Duque de Estrada 
<[email protected]>
Add test coverage for AbstractDetachedCriteria and rx DetachedCriteria

Adds mock-based unit specs for AbstractDetachedCriteria (via 
grails.gorm.DetachedCriteria)
and for the reactive grails.gorm.rx.DetachedCriteria, taking both from ~0% to 
full
line/method coverage without needing a real datastore.

Writing the rx specs surfaced two real bugs, both fixed here:
- buildQueryableCriteria() cast the built DetachedCriteria to 
QueryableCriteria, but the rx
  class never implemented that interface, so every closure-based subquery (in, 
inList, notIn,
  eqAll/gtAll/ltAll/geAll/leAll, gtSome/geSome/ltSome/leSome) threw a 
ClassCastException at
  runtime. Fixed with a small SubqueryAdapter that extends the shared 
AbstractDetachedCriteria
  base directly, since the reactive class's own find()/list() return Observable 
and can't
  coexist with QueryableCriteria's T/List<T> signatures on the same type.
- prepareQuery() applied fetch strategies (join/select) twice: once via
  DynamicFinder.applyDetachedCriteria(), then again via a redundant hand-rolled 
loop that also
  ignored custom JoinTypes. Removed the dead duplicate.

Also fixes a handful of definite-assignment/shadowing/raw-getAt warnings in
AbstractDetachedCriteria (uninitialized `prop` in createAlias, a local variable 
named
`criteria` shadowing the instance field of the same name in clone(), and 
negative-index
List access replaced with getLast()).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

Report URL: https://github.com/apache/grails-core/actions/runs/31639141725

With regards,
GitHub Actions via GitBox

Reply via email to