@@ -1593,7 +1593,13 @@ public static InterfaceDeclaration getInterfaceForInstancePythonFunction(String
1593
1593
pythonParameterTypes [0 ] = 'L' + instanceInternalClassName + ';' ;
1594
1594
}
1595
1595
1596
- for (int i = 1 ; i < pythonCompiledFunction .totalArgCount (); i ++) {
1596
+ return getInterfaceDeclaration (pythonCompiledFunction , parameterPythonTypeList , pythonParameterTypes );
1597
+ }
1598
+
1599
+ private static PythonClassTranslator .InterfaceDeclaration getInterfaceDeclaration (
1600
+ PythonCompiledFunction pythonCompiledFunction , List <PythonLikeType > parameterPythonTypeList ,
1601
+ String [] pythonParameterTypes ) {
1602
+ for (int i = 1 ; i < pythonParameterTypes .length ; i ++) {
1597
1603
pythonParameterTypes [i ] = 'L' + parameterPythonTypeList .get (i ).getJavaTypeInternalName () + ';' ;
1598
1604
}
1599
1605
String returnType = 'L' + pythonCompiledFunction .getReturnType ().map (PythonLikeType ::getJavaTypeInternalName )
@@ -1611,14 +1617,7 @@ public static InterfaceDeclaration getInterfaceForClassPythonFunction(PythonComp
1611
1617
pythonParameterTypes [0 ] = Type .getDescriptor (PythonLikeType .class );
1612
1618
}
1613
1619
1614
- for (int i = 1 ; i < pythonCompiledFunction .totalArgCount (); i ++) {
1615
- pythonParameterTypes [i ] = 'L' + parameterPythonTypeList .get (i ).getJavaTypeInternalName () + ';' ;
1616
- }
1617
- String returnType = 'L' + pythonCompiledFunction .getReturnType ().map (PythonLikeType ::getJavaTypeInternalName )
1618
- .orElseGet (() -> getPythonReturnTypeOfFunction (pythonCompiledFunction , true ).getJavaTypeInternalName ()) + ';' ;
1619
- FunctionSignature functionSignature = new FunctionSignature (returnType , pythonParameterTypes );
1620
- return functionSignatureToInterfaceName .computeIfAbsent (functionSignature ,
1621
- PythonClassTranslator ::createInterfaceForFunctionSignature );
1620
+ return getInterfaceDeclaration (pythonCompiledFunction , parameterPythonTypeList , pythonParameterTypes );
1622
1621
}
1623
1622
1624
1623
public static InterfaceDeclaration createInterfaceForFunctionSignature (FunctionSignature functionSignature ) {
0 commit comments