jamesfredley commented on code in PR #15557:
URL: https://github.com/apache/grails-core/pull/15557#discussion_r3343111226
##########
grails-test-examples/mongodb/base/grails-app/controllers/functional/tests/BookController.groovy:
##########
@@ -37,8 +37,8 @@ class BookController {
*/
def bindParams = ['title']
- def index(Integer max) {
- params.max = Math.min(max ?: 10, 100)
+ def index() {
Review Comment:
Reverted - restored `def index(Integer max)`. The `params.int('max', 10)`
rewrite was the manual `indy=false` workaround, now handled framework-side by
`OptimizingStatementWriter.ClassNodeSkip`.
##########
grails-test-examples/mongodb/hibernate5/grails-app/controllers/functional/tests/AuthorController.groovy:
##########
@@ -35,8 +35,8 @@ class AuthorController {
*/
def bindParams = ['name']
- def index(Integer max) {
- params.max = Math.min(max ?: 10, 100)
+ def index() {
Review Comment:
Reverted - restored `def index(Integer max)`. The `params.int('max', 10)`
rewrite was the manual `indy=false` workaround, now handled framework-side by
`OptimizingStatementWriter.ClassNodeSkip`.
##########
grails-test-examples/mongodb/hibernate5/grails-app/controllers/functional/tests/BookController.groovy:
##########
@@ -34,8 +34,8 @@ class BookController {
*/
def bindParams = ['title']
- def index(Integer max) {
- params.max = Math.min(max ?: 10, 100)
+ def index() {
+ params.max = Math.min(params.int('max', 10), 100)
Review Comment:
Reverted - restored `def index(Integer max)`. The `params.int('max', 10)`
rewrite was the manual `indy=false` workaround, now handled framework-side by
`OptimizingStatementWriter.ClassNodeSkip`.
##########
grails-test-examples/views-functional-tests/grails-app/controllers/functional/tests/ProductController.groovy:
##########
@@ -34,9 +34,8 @@ class ProductController extends RestfulController<Product> {
* @param max The maximum
* @return A list of resources
*/
- @Override
- def index(Integer max) {
- params.max = Math.min(max ?: 10, 100)
+ def index() {
Review Comment:
Reverted - restored `@Override def index(Integer max)`. The signature change
+ `params.int` rewrite was the `indy=false` workaround; with
`OptimizingStatementWriter.ClassNodeSkip` handling parameterized actions,
`ProductController` overrides `RestfulController.index(Integer max)` again as
before.
##########
grails-test-examples/views-functional-tests/grails-app/controllers/functional/tests/TeamController.groovy:
##########
@@ -38,11 +38,11 @@ class TeamController extends RestfulController {
respond Composite.findByTeamAndPlayer(Team.load(1), Player.load(2))
}
- def deep(Long id) {
- respond Team.get(id)
+ def deep() {
Review Comment:
Reverted - restored `def deep(Long id)` and `def hal(Long id)`. The
`params.long('id')` rewrite was the `indy=false` workaround, now handled
framework-side by `OptimizingStatementWriter.ClassNodeSkip`.
##########
grails-test-suite-persistence/src/test/groovy/grails/web/databinding/GrailsWebDataBinderSpec.groovy:
##########
@@ -1806,12 +1804,21 @@ class Widget {
isNotBindable(bindable: false)
timeZone(nullable: true)
}
+
+ // Manual Comparable implementation (replaces @Sortable which conflicts
with @Entity in Groovy 5)
Review Comment:
Under Groovy 5 the `@Sortable` AST transform and GORM's `@Entity` transform
clash on the same class - `@Sortable` generates `compareTo`/comparators over
the persistent properties while `@Entity` is also rewriting the class, and the
combination fails to compile under Groovy 5's stricter checking. Since these
are just test fixtures, I replaced `@Sortable(includes=[...])` with an
equivalent hand-written `compareTo`/`Comparable`. It is a test-only workaround
for the transform interaction; I can open a Groovy issue with a standalone
reproducer if you want it tracked upstream, and it may be worth an
upgrade-guide note if it affects user `@Entity` + `@Sortable` classes generally.
--
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]