File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/main/java/org/scijava Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 3131
3232package org .scijava .object ;
3333
34-
3534import java .util .List ;
3635
3736import org .scijava .event .EventHandler ;
Original file line number Diff line number Diff line change @@ -311,6 +311,13 @@ public static <A extends Annotation> List<Method> getAnnotatedMethods(
311311
312312 // check supertypes for annotated methods first
313313 getAnnotatedMethods (c .getSuperclass (), annotationClass , methods );
314+ // NB: In some cases, we may not need to recursively scan interfaces.
315+ // In particular, for the @EventHandler annotation, we only care about
316+ // concrete methods, not interface method declarations. So we could have
317+ // additional method signatures with a boolean toggle indicating whether
318+ // to include interfaces in the recursive scan. But initial benchmarks
319+ // suggest that the performance difference, even when creating a
320+ // full-blown Context with a large classpath, is negligible.
314321 for (final Class <?> iface : c .getInterfaces ()) {
315322 getAnnotatedMethods (iface , annotationClass , methods );
316323 }
You can’t perform that action at this time.
0 commit comments