enapps-enorman commented on code in PR #26:
URL: 
https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/26#discussion_r1190238601


##########
core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java:
##########
@@ -135,6 +136,35 @@ public static boolean modified(Object target, 
MockComponentContext componentCont
                 + " found in class " + targetClass.getName());
     }
 
+    /**
+     * SLING-11860 - find the nearest match.  First find any match in the 
class itself.
+     *     If none is found, then walk up the ancestor super classes to look 
for a match
+     *
+     * @param targetClass the class to start from
+     * @param fn the function to find and invoke the method
+     * @return the found method or null if not found
+     */
+    private static boolean findAndInvokeNearestMethod(Class<?> targetClass, 
Predicate<Class<?>> fn) {

Review Comment:
   Well, I thought the javadoc for the "fn" param made it clear that the 
predicate function was responsible for finding and invoking the method and 
returning whether it was handled or not.  
   
   But I am open to suggestions if you want to propose a better name.



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