Closed dingiso closed 6 months ago
That is a very complex call. Your best bet would be to force casting on each argument and determine which casting operator failed.
To use a cast apply the "@" operator.
Ie. java.lang.String@"hello" would force the type of the argument to be java.lang.String rather than a Python string.
My guess is some automatic conversion that you are assuming doesn't work. It may be fixed by casting, or it may tell you the conversion is not possible. But either way it should move you towards a solutions.
Thanks, I have found the solution, jpype will not convert python list to java list in this situation, after I change the original [file]
to java.util.ArrayList([file])
, it goes OK.
Best Regards,
Dingisoul
Hi everyone,
I am using jpype to call java functions. However, the function signature is not matched. I am trying to fix but it still wrong. Can someone help me to figure out?
The java function is as below: ( sorry about it, this function is too long and many self-defined types, but I have carefully handled them)
The wrong message output by python is as below:
The code I used to call the function
The type error comes out, as we can see there are two parameters do not have same type:
NoneType vs java.util.List
one best practice of this function in ghidra give this parameter anull
, so I think it's all right since jpype can change None to required typeNoneType vs java.util.function.Predicate
similar with aboveTasMonitor vs ConsolTaskMonitor
this ConsoleTaskMonitor is a subclass of TaskMonitor, and I think it's not wrong because I have use the same parameter in other function which also takes a TaskMonitor as parameterList
parameter: I do not know if the type of the list element will make the type check fail, but I think their type is rightIf everyone could help me or give me some advice, I will fully appreciate it.
Best Regards, Dingisoul