I started a "for fun, nobody knows, nobody cares" open source project (LinkSet).
In one place I need to get an annotated method of a class.
Is there a more efficient way to do it than this? I mean without the need of iterating through every method?
for (final Method method : cls.getDeclaredMethods()) {
final HandlerMethod handler = method.getAnnotation(HandlerMethod.class);
if (handler != null) {
return method;
}
}