greenrobot / EventBus

Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
http://greenrobot.org/eventbus/
Apache License 2.0
24.67k stars 4.66k forks source link

Suggestion:delete the judgtment of subscriberMethods.isEmpty() #619

Open konstant2016 opened 4 years ago

konstant2016 commented 4 years ago

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

so:When subscriberMethods is empty, it returns subscriberMethods directly and no more errors are reported

tomridder commented 1 year ago

that 's nice cause when subscriberMethods have no data but it 's not null,it will not crash but with EventBusException throwed ,the developers will know the reason of not recevie events

konstant2016 commented 1 year ago

已经成功收到您的邮件