jdaugherty commented on code in PR #16491:
URL: https://github.com/apache/grails-core/pull/16491#discussion_r4175004904


##########
grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java:
##########
@@ -150,6 +176,10 @@ static List getBindablePropertyNames(final Object object) {
     }
 
     static List getUnbindablePropertyNames(final Object object) {
+        if (BindingIncludeLists.inheritsConstraintsMap(object.getClass())) {
+            // The inherited accessor holds the superclass's constraints, so 
the class's own are evaluated once.
+            return getUnbindablePropertyNames(object.getClass());

Review Comment:
   Fixed in 9fd34ca839. `inheritsConstraintsMap` now matches only the static 
`getConstraintsMap()` that `Validateable` adds: the method must be inherited, 
static, and carry Groovy's `@Traits.TraitBridge` with `Validateable` as its 
trait. An inherited instance getter, including the one Groovy generates for a 
superclass `Map constraintsMap` property, no longer matches, so both early 
returns fall through to the instance's map again.
   
   `InheritedCommandBindingSpec` adds the regression: two instances of a 
subclass that inherits an instance `constraintsMap`, each map protecting a 
different property, bound through both `bindData` and 
`DataBindingUtils.bindObjectToInstance`. Each instance keeps its own `bindable: 
false` property and binds the other. Both features fail with the previous 
predicate.



-- 
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]

Reply via email to