Github user sun-rui commented on a diff in the pull request:
https://github.com/apache/spark/pull/8458#discussion_r39115489
--- Diff: core/src/main/scala/org/apache/spark/api/r/RBackendHandler.scala
---
@@ -166,40 +178,75 @@ private[r] class RBackendHandler(server: RBackend)
// Read a number of arguments from the data input stream
def readArgs(numArgs: Int, dis: DataInputStream):
Array[java.lang.Object] = {
- (0 until numArgs).map { arg =>
+ (0 until numArgs).map { _ =>
readObject(dis)
}.toArray
}
- // Checks if the arguments passed in args matches the parameter types.
- // NOTE: Currently we do exact match. We may add type conversions later.
+ // Find a matching method in all methods of the same name of a class
+ // according to the passed arguments. Arguments may be converted in
+ // order to match a method.
+ //
+ // Returns an Option[Int] which is the index of the matched method in
--- End diff --
In java reflection, constructors and normal methods are of different
classes, and share no parent class that provides methods for reflection uses. I
can't find a unified way to handle them in this function, so I have to pass in
parameterTypes: Array[Class[_]] and return an index.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]