bkoehm commented on code in PR #16296:
URL: https://github.com/apache/grails-core/pull/16296#discussion_r3925544370


##########
grails-converters/src/main/groovy/org/grails/web/converters/marshaller/json/GenericJavaBeanMarshaller.java:
##########
@@ -64,14 +66,17 @@ public void marshalObject(Object o, JSON json) throws 
ConverterException {
                     if (Modifier.isStatic(readMethod.getModifiers())) continue;
                     if (readMethod.getAnnotation(PersistenceMethod.class) != 
null) continue;
                     if (readMethod.getAnnotation(ControllerMethod.class) != 
null) continue;
-                    Object value = readMethod.invoke(o, (Object[]) null);
+                    Method invokableMethod = 
ClassUtils.getInterfaceMethodIfPossible(readMethod, clazz);

Review Comment:
   I don't see much downside to going the "not mutated" case but I acknowledge 
the concern may be performance, as you put it: "Cost is one extra reflective 
lookup per property per marshal."  I think this is an acceptable cost, but it's 
easy for me to say that as I don't have visibility into that potential cost for 
other people.  I will accept that low cost.  I'm a thumbs up on the "not 
mutated" case suggestion.



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