This is an automated email from the ASF dual-hosted git repository.
matrei pushed a commit to branch grails8-groovy5-sb4
in repository https://gitbox.apache.org/repos/asf/grails-core.git
The following commit(s) were added to refs/heads/grails8-groovy5-sb4 by this
push:
new 3842442f69 test: revert workaround for combined `@Entity` and
`@Sortable`
3842442f69 is described below
commit 3842442f6952d70e8a59f8951f79edf728191d4d
Author: Mattias Reichel <[email protected]>
AuthorDate: Mon Jun 15 12:40:56 2026 +0200
test: revert workaround for combined `@Entity` and `@Sortable`
Fixed upstream by https://github.com/apache/groovy/pull/2611
---
.../web/databinding/GrailsWebDataBinderSpec.groovy | 30 +++++-----------------
1 file changed, 6 insertions(+), 24 deletions(-)
diff --git
a/grails-test-suite-persistence/src/test/groovy/grails/web/databinding/GrailsWebDataBinderSpec.groovy
b/grails-test-suite-persistence/src/test/groovy/grails/web/databinding/GrailsWebDataBinderSpec.groovy
index 8e11e2b028..17001a0afb 100644
---
a/grails-test-suite-persistence/src/test/groovy/grails/web/databinding/GrailsWebDataBinderSpec.groovy
+++
b/grails-test-suite-persistence/src/test/groovy/grails/web/databinding/GrailsWebDataBinderSpec.groovy
@@ -18,6 +18,8 @@
*/
package grails.web.databinding
+import groovy.transform.Sortable
+
import grails.databinding.BindUsing
import grails.databinding.BindingFormat
import grails.databinding.DataBindingSource
@@ -1785,8 +1787,9 @@ class Author {
}
@Entity
+@Sortable(includes = ['isBindable', 'isNotBindable'])
@SuppressWarnings('unused')
-class Widget implements Comparable<Widget> {
+class Widget {
String isBindable
String isNotBindable
@@ -1804,22 +1807,12 @@ class Widget implements Comparable<Widget> {
isNotBindable(bindable: false)
timeZone(nullable: true)
}
-
- // Groovy 5 still NPEs during canonicalization when @Sortable is combined
with @Entity.
- @Override
- int compareTo(Widget other) {
- int result = isBindable <=> other.isBindable
- if (result == 0) {
- result = isNotBindable <=> other.isNotBindable
- }
- return result
- }
-
}
@Entity
+@Sortable(includes = ['isBindable', 'isNotBindable'])
@SuppressWarnings('unused')
-class ParentWidget implements Validateable, Comparable<ParentWidget> {
+class ParentWidget implements Validateable {
String isBindable
String isNotBindable
@@ -1838,17 +1831,6 @@ class ParentWidget implements Validateable,
Comparable<ParentWidget> {
isNotBindable(bindable: false)
timeZone(nullable: true)
}
-
- // Groovy 5 still NPEs during canonicalization when @Sortable is combined
with @Entity.
- @Override
- int compareTo(ParentWidget other) {
- int result = isBindable <=> other.isBindable
- if (result == 0) {
- result = isNotBindable <=> other.isNotBindable
- }
- return result
- }
-
}
@Entity