Closed jay2013 closed 6 years ago
The default EventBusBuilder
is used, which sets:
strictMethodVerification
= falseignoreGeneratedIndex
= falseWhen MainActivity
starts for the first time, SubscriberMethodFinder.findSubscriberMethods()
is called. The first time, the cache is empty. Since ignoreGeneratedIndex
is false, it doesn't call findUsingReflection()
. Instead, it calls findUsingInfo()
, which calls findUsingReflectionInSingleClass()
. Once here, method.isAnnotationPresent()
isn't called because strictMethodVerification
is false.
Tested by adding breakpoints on api level 22 and 24 devices.
For more info on how this library works internally (in particular how the default builder works), please check out their repo: https://github.com/greenrobot/EventBus
Hi, Our tool report that API "<java.lang.reflect.Method: boolean isAnnotationPresent(java.lang.Class)> " called in "<org.greenrobot.eventbus.SubscriberMethodFinder: void findUsingReflectionInSingleClass(org.greenrobot.eventbus.SubscriberMethodFinder$FindState)>" on line 179 is not in level [24, 25].
We also checked your codes but we are not sure whether "strictMethodVerification" is always false when your app run on devices of level [24, 25].
Please help to check it, thanks very much.
best regards,
Dongjie He