pjfanning commented on code in PR #17312:
URL: 
https://github.com/apache/dolphinscheduler/pull/17312#discussion_r2177540183


##########
dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/server/ServerMethodInvokerImpl.java:
##########
@@ -44,6 +50,26 @@ public Object invoke(Object... args) throws Throwable {
         }
     }
 
+    @Override
+    public boolean isParameterTypeValidated(Class<?>[] argsTypes) {
+        if (argsTypes == null || argsTypes.length == 0) {
+            return parameterTypes.isEmpty();
+        }
+        if (parameterTypes.size() != argsTypes.length) {
+            return false;
+        }
+        for (int i = 0; i < parameterTypes.size(); i++) {
+            Class<?> argType = argsTypes[i];
+            if (argType == null) {
+                continue;
+            }
+            if (parameterTypes.get(i) != argType) {

Review Comment:
   one option here is to use 
https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#isAssignableFrom-java.lang.Class-
   
   * this would allow subclasses to be accepted
   * the current check only works if the classes are an exact match
   
   The if would look something like:
   `if (parameterTypes.get(i).isAssignableFrom(argType)`
   
   This is worth testing because of I have a habit of getting this check the 
wrong way around.
   
    
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to