You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
I found a source error in JavaModuleWrapper.java #16934
@DoNotStripprivatevoidfindMethods() {
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "findMethods");
// define a methodNames set,But we don't add methods to the collectionSet<String> methodNames = newHashSet<>();
Class<? extendsNativeModule> classForMethods = mModuleClass;
Class<? extendsNativeModule> superClass =
(Class<? extendsNativeModule>) 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 (MethodtargetMethod : targetMethods) {
ReactMethodannotation = targetMethod.getAnnotation(ReactMethod.class);
if (annotation != null) {
StringmethodName = targetMethod.getName();
if (methodNames.contains(methodName)) {
// We do not support method overloading since js sees a function as an object regardless// of number of params.thrownewIllegalArgumentException(
"Java Module " + getName() + " method name already registered: " + methodName);
}
MethodDescriptormd = newMethodDescriptor();
JavaMethodWrappermethod = newJavaMethodWrapper(this, targetMethod, annotation.isBlockingSynchronousMethod());
md.name = methodName;
md.type = method.getType();
if (md.type == BaseJavaModule.METHOD_TYPE_SYNC) {
md.signature = method.getSignature();
md.method = targetMethod;
}
mMethods.add(method);
mDescs.add(md);
}
}
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
}
At first,We define a set collection methodNames,then we call methodNames.contains(methodName) to determine whether there is a repeat method.But we don't add methods to the collection.I don't know what this methodNames set means
Hey @wo883721, thanks for posting this! It looks like your issue is missing some required information. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce your issue. I am going to close this, but please feel free to open a new issue with the additional information provided. Thanks!
Activity
react-native-bot commentedon Nov 23, 2017
@facebook-github-bot no-template
facebook-github-bot commentedon Nov 23, 2017
Hey @wo883721, thanks for posting this! It looks like your issue is missing some required information. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce your issue. I am going to close this, but please feel free to open a new issue with the additional information provided. Thanks!
How to Contribute • What to Expect from Maintainers