You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by bo...@apache.org on 2026/08/16 01:29:12 UTC
(grails-core) 05/11: Suppress MethodMayBeStatic on lookupById(), which is polymorphic
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch test/document-datamapping-core-services
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit c0bec23cf4d9004cf6ed77f8a9e584c2f4cb548b
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Sat Aug 15 19:25:50 2026 -0500
Suppress MethodMayBeStatic on lookupById(), which is polymorphic
AbstractProjectionImplementer overrides lookupById() to return false,
and doImplement() dispatches on it via virtual call. Making it static
would silently break that override rather than just being unnecessary,
so it's suppressed with an explanation instead of "fixed".
Co-Authored-By: Claude Sonnet 5 <no...@anthropic.com>
---
.../implementers/AbstractDetachedCriteriaServiceImplementor.groovy | 3 +++
1 file changed, 3 insertions(+)
diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AbstractDetachedCriteriaServiceImplementor.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AbstractDetachedCriteriaServiceImplementor.groovy
index 56fbfd7112..95fbef54f3 100644
--- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AbstractDetachedCriteriaServiceImplementor.groovy
+++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AbstractDetachedCriteriaServiceImplementor.groovy
@@ -153,6 +153,9 @@ abstract class AbstractDetachedCriteriaServiceImplementor extends AbstractReadOp
* Whether lookup by id is allowed by this implementation
* @return True if it is
*/
+ // Not static: AbstractProjectionImplementer overrides this to return false, and
+ // doImplement() dispatches on it polymorphically. A static method would break that override.
+ @SuppressWarnings('MethodMayBeStatic')
protected boolean lookupById() {
return true
}