mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
move @ReactMethod to the codegen'ed class so impl class don't need it anymore
Reviewed By: javache Differential Revision: D5074121 fbshipit-source-id: 1b23a5d26ffe27c5093677ae7ecca424b232c8aa
This commit is contained in:
committed by
Facebook Github Bot
parent
0040b02469
commit
3d3f74dc72
@@ -78,7 +78,17 @@ public class JavaModuleWrapper {
|
||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "findMethods");
|
||||
Set<String> methodNames = new HashSet<>();
|
||||
|
||||
Method[] targetMethods = mModuleClass.getDeclaredMethods();
|
||||
Class<? extends NativeModule> classForMethods = mModuleClass;
|
||||
Class<? extends NativeModule> superClass =
|
||||
(Class<? extends NativeModule>) mModuleClass.getSuperclass();
|
||||
if (ReactModuleWithSpec.class.isAssignableFrom(superClass)) {
|
||||
// For java module that is based on generated flow-type spec, inspect the
|
||||
// spec abstract class instead, which is the super class of the given java
|
||||
// module.
|
||||
classForMethods = superClass;
|
||||
}
|
||||
Method[] targetMethods = classForMethods.getDeclaredMethods();
|
||||
|
||||
for (Method targetMethod : targetMethods) {
|
||||
ReactMethod annotation = targetMethod.getAnnotation(ReactMethod.class);
|
||||
if (annotation != null) {
|
||||
|
||||
Reference in New Issue
Block a user