Suggestion:delete the judgtment of subscriberMethods.isEmpty()
Author: konstant2016Created Nov 20, 2019Updated Mar 27, 2023
Labelsenhancement
Phenomenon: usually we register EventBus in the base class and annotate the subscribe method in the subclass, but if there is no public method in the subclass,the Eventbus will report : Fragment and its super classes have no public methods with the @Subscribe annotation
Suggestion: delete this code: if (subscriberMethods.isEmpty()) { throw new EventBusException("Subscriber " + subscriberClass + " and its super classes have no public methods with the @Subscribe annotation"); }
so:When subscriberMethods is empty, it returns subscriberMethods directly and no more errors are reported
Source: greenrobot/EventBus