EventBus icon indicating copy to clipboard operation
EventBus copied to clipboard

Suggestion:delete the judgtment of subscriberMethods.isEmpty()

Open konstant2016 opened this issue 6 years ago • 2 comments

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

konstant2016 avatar Nov 20 '19 08:11 konstant2016

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

sunreview avatar Mar 15 '23 18:03 sunreview

已经成功收到您的邮件

konstant2016 avatar Mar 15 '23 18:03 konstant2016