apache / apache/grails-core

H7: Replace fully-qualified class names with imports and use var in HibernateCriteriaBuilder and CollectionBinder

Open Beginner friendly
#15,764 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

## Summary

Two classes in `grails-data-hibernate7` were ported from H5 code and carry style issues that were intentionally deferred from PR #15568 to keep the review surface focused on the H7 integration work.

## Files

- `grails-data-hibernate7/core/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java`
- Many fully-qualified class names used inline (e.g. `org.hibernate.Session`, `grails.gorm.DetachedCriteria`) instead of imports
- Local variable types that could use `var`

- `grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/binder/CollectionBinder.java`
- Local variable declarations that could use `var` (e.g. line 95)

## Work

1. Replace inline FQCNs with import statements in `HibernateCriteriaBuilder.java`
2. Replace eligible local variable declarations with `var` in both files
3. Run `./gradlew :grails-data-hibernate7-core:test` to verify no regressions

## References

- PR #15568 (H7 Step 2) — review comments from @matrei

Contributor guide

Open the contributing guide

Research direction

Start with grails-data-hibernate7/core/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java and inspect its inline fully-qualified names and local variable declarations. Then review CollectionBinder.java, including the declaration around line 95. Replace eligible declarations as described and run ./gradlew :grails-data-hibernate7-core:test; done means both files use imports and var where appropriate with tests passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.