EventBus
EventBus copied to clipboard
why not use method but the string of method name in SubscriberMethodInfo
if use method can avoid using Java reflection, i think.
protected SubscriberMethod createSubscriberMethod(String methodName, Class<?> eventType, ThreadMode threadMode,
int priority, boolean sticky) {
try {
_### **Method method = subscriberClass.getDeclaredMethod(methodName, eventType);**_
return new SubscriberMethod(method, eventType, threadMode, priority, sticky);
} catch (NoSuchMethodException e) {
throw new EventBusException("Could not find subscriber method in " + subscriberClass +
". Maybe a missing ProGuard rule?", e);
}
}
even use Method..it is still invoke on Runtime ... so it's still use reflection