I'd like to use the @ServiceActivator annotation on a Java 8 default interface method. This does not work because Spring Integration relies on the ReflectionUtils.doWithMethods, which uses ReflectionUtils.getDeclaredMethods and the last one just does this clazz.getDeclaredMethods(), which doesn't return those default methods on the interface.
This is a fine fit for 4.2 since we have other issues related to default methods already and intend to do a framework-wide revision for proper default method handling. I'll use this issue for that purpose since many parts of the framework delegate to ReflectionUtils and would immediately benefit from default method exposure, maybe with a little bit of tweaking.
ReflectionUtils.doWithMethods covers applicable default methods as well now, as declared on any interfaces implemented by the given class.
A new doWithLocalMethods variant provides the same coverage but without traversing the inheritance hierarchy, as needed by our common traversal algorithm in the annotation post-processors. A corresponding doWithLocalFields has been introduced for consistent structuring.
Also, doWithFields as well as doWithLocalFields use a cache for Field.getDeclaredFields() now, analogous to the existing cache for declared methods (introduced in 4.1 as part of #16501).