Github user ecerulm commented on a diff in the pull request:
https://github.com/apache/groovy/pull/693#discussion_r185943651
--- Diff: src/main/groovy/groovy/lang/MetaClassImpl.java ---
@@ -945,6 +945,15 @@ private Object invokeMissingMethod(Object instance,
String methodName, Object[]
onInvokeMethodFoundInHierarchy(method);
return method.invoke(instance, invokeMethodArgs);
}
+
+ // last resort look in the category
+ if (method == null &&
GroovyCategorySupport.hasCategoryInCurrentThread()) {
+ method = getCategoryMethodMissing(instanceKlazz);
+ if (method != null) {
+ //TODO add onMethodMissingFound(method)
--- End diff --
No, I think I should just remove that TODO. Currently there is no
onMethodMissingFound() for the "regular" methodMissing() (not from a category).
As far as I understand the on*Found() hooks are only used by the
ExpandoMetaClass to store/cache resolved methods, and I guess the missingMethod
from a category should not be remembered (it should disappear after the
category is no longer in effect).
---