jdaugherty commented on code in PR #15557:
URL: https://github.com/apache/grails-core/pull/15557#discussion_r3341541233
##########
grails-fields/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorFactory.groovy:
##########
@@ -125,12 +125,31 @@ class BeanPropertyAccessorFactory implements
GrailsApplicationAware {
private Constrained resolveConstraints(BeanWrapper beanWrapper, String
propertyName) {
Class<?> type = beanWrapper.wrappedClass
- boolean defaultNullable = Validateable.isAssignableFrom(type) ?
type.metaClass.invokeStaticMethod(type, 'defaultNullable') : false
+ boolean defaultNullable = Validateable.isAssignableFrom(type) ?
resolveDefaultNullable(type) : false
ConstrainedProperty constraint = constraintsEvaluator.evaluate(type,
defaultNullable)[propertyName]
new Constrained(constraint ?: createDefaultConstraint(beanWrapper,
propertyName))
}
+ private static boolean resolveDefaultNullable(Class<?> clazz) {
Review Comment:
So we've fallen back to reflection instead of using the metaclass to invoke?
Can you explain why this is needed?
--
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]