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 <[email protected]>
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 <[email protected]>
---
 .../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
     }

Reply via email to